From e27903be33aa349da237a6305b9a8130e7a48a97 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo <1102197+priyadi@users.noreply.github.com> Date: Mon, 7 Oct 2024 21:44:56 +0700 Subject: [PATCH] fix: do not run DebugPass if symfony/stopwatch is not present (#207) * fix: do not run DebugPass if symfony/stopwatch is not present * update changelog --- CHANGELOG.md | 8 +++----- src/DependencyInjection/CompilerPass/DebugPass.php | 6 ++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bf33d9..1b9858f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,11 @@ # CHANGELOG -## 1.10.0 - -* fix: `Map` now works with unpromoted constructor parameters -* fix: restore throwing `NewInstanceReturnedButCannotBeSetOnTargetException` - ## 1.9.4 * deps: fix `symfony/stopwatch` dependency +* fix: `Map` now works with unpromoted constructor parameters +* fix: restore throwing `NewInstanceReturnedButCannotBeSetOnTargetException` +* fix: do not run DebugPass if symfony/stopwatch is not present ## 1.9.3 diff --git a/src/DependencyInjection/CompilerPass/DebugPass.php b/src/DependencyInjection/CompilerPass/DebugPass.php index 6e41330..bb2ae42 100644 --- a/src/DependencyInjection/CompilerPass/DebugPass.php +++ b/src/DependencyInjection/CompilerPass/DebugPass.php @@ -29,6 +29,12 @@ #[\Override] public function process(ContainerBuilder $container): void { + // return if debug.stopwatch does not exist + + if (!$container->has('debug.stopwatch')) { + return; + } + // decorates all transformers using TraceableTransformer $dataCollector = new Reference('rekalogika.mapper.data_collector');