From 7db670af2d950ed1b2b3cca5632c55fda198b7e1 Mon Sep 17 00:00:00 2001 From: loic Date: Wed, 8 Oct 2025 10:23:21 +0200 Subject: [PATCH] * Fix File Exceptions integration --- CHANGELOG.md | 3 +++ src/CodeRhapsodieDataflowBundle.php | 2 ++ src/DependencyInjection/Configuration.php | 8 ++++---- src/ExceptionsHandler/FilesystemExceptionHandler.php | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e8db49..4bc8f7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# Version 5.4.1 +* Fix File Exceptions integration + # Version 5.4.0 * Add possibility to save exceptions in file diff --git a/src/CodeRhapsodieDataflowBundle.php b/src/CodeRhapsodieDataflowBundle.php index fd84009..9c5f562 100644 --- a/src/CodeRhapsodieDataflowBundle.php +++ b/src/CodeRhapsodieDataflowBundle.php @@ -8,6 +8,7 @@ use CodeRhapsodie\DataflowBundle\DependencyInjection\Compiler\BusCompilerPass; use CodeRhapsodie\DataflowBundle\DependencyInjection\Compiler\DataflowTypeCompilerPass; use CodeRhapsodie\DataflowBundle\DependencyInjection\Compiler\DefaultLoggerCompilerPass; +use CodeRhapsodie\DataflowBundle\DependencyInjection\Compiler\ExceptionCompilerPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; use Symfony\Component\HttpKernel\Bundle\Bundle; @@ -30,6 +31,7 @@ public function build(ContainerBuilder $container): void ->addCompilerPass(new DataflowTypeCompilerPass()) ->addCompilerPass(new DefaultLoggerCompilerPass()) ->addCompilerPass(new BusCompilerPass()) + ->addCompilerPass(new ExceptionCompilerPass()) ; } } diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index bd0a67b..12a6df0 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -46,10 +46,10 @@ public function getConfigTreeBuilder(): TreeBuilder ->end() ->scalarNode('flysystem_service') ->end() - ->validate() - ->ifTrue(static fn ($v): bool => $v['type'] === 'file' && !interface_exists('\League\Flysystem\Filesystem')) - ->thenInvalid('You need "league/flysystem" to use Dataflow file exception mode.') - ->end() + ->end() + ->validate() + ->ifTrue(static fn ($v): bool => $v['type'] === 'file' && !class_exists('\League\Flysystem\Filesystem')) + ->thenInvalid('You need "league/flysystem" to use Dataflow file exception mode.') ->end() ->end() ->end() diff --git a/src/ExceptionsHandler/FilesystemExceptionHandler.php b/src/ExceptionsHandler/FilesystemExceptionHandler.php index 1fd5bac..9176cf7 100644 --- a/src/ExceptionsHandler/FilesystemExceptionHandler.php +++ b/src/ExceptionsHandler/FilesystemExceptionHandler.php @@ -25,7 +25,7 @@ public function save(?int $jobId, ?array $exceptions): void public function find(int $jobId): ?array { try { - if (!$this->filesystem->has(\sprintf('dataflow-job-%s.log', $jobId))) { + if (!$this->filesystem->fileExists(\sprintf('dataflow-job-%s.log', $jobId))) { return []; }