Skip to content

Commit 6ebbdbd

Browse files
authored
* Fix File Exceptions integration (#82)
1 parent 405ce87 commit 6ebbdbd

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Version 5.4.1
2+
* Fix File Exceptions integration
3+
14
# Version 5.4.0
25
* Add possibility to save exceptions in file
36

src/CodeRhapsodieDataflowBundle.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use CodeRhapsodie\DataflowBundle\DependencyInjection\Compiler\BusCompilerPass;
99
use CodeRhapsodie\DataflowBundle\DependencyInjection\Compiler\DataflowTypeCompilerPass;
1010
use CodeRhapsodie\DataflowBundle\DependencyInjection\Compiler\DefaultLoggerCompilerPass;
11+
use CodeRhapsodie\DataflowBundle\DependencyInjection\Compiler\ExceptionCompilerPass;
1112
use Symfony\Component\DependencyInjection\ContainerBuilder;
1213
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
1314
use Symfony\Component\HttpKernel\Bundle\Bundle;
@@ -30,6 +31,7 @@ public function build(ContainerBuilder $container): void
3031
->addCompilerPass(new DataflowTypeCompilerPass())
3132
->addCompilerPass(new DefaultLoggerCompilerPass())
3233
->addCompilerPass(new BusCompilerPass())
34+
->addCompilerPass(new ExceptionCompilerPass())
3335
;
3436
}
3537
}

src/DependencyInjection/Configuration.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ public function getConfigTreeBuilder(): TreeBuilder
4646
->end()
4747
->scalarNode('flysystem_service')
4848
->end()
49-
->validate()
50-
->ifTrue(static fn ($v): bool => $v['type'] === 'file' && !interface_exists('\League\Flysystem\Filesystem'))
51-
->thenInvalid('You need "league/flysystem" to use Dataflow file exception mode.')
52-
->end()
49+
->end()
50+
->validate()
51+
->ifTrue(static fn ($v): bool => $v['type'] === 'file' && !class_exists('\League\Flysystem\Filesystem'))
52+
->thenInvalid('You need "league/flysystem" to use Dataflow file exception mode.')
5353
->end()
5454
->end()
5555
->end()

src/ExceptionsHandler/FilesystemExceptionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function save(?int $jobId, ?array $exceptions): void
2525
public function find(int $jobId): ?array
2626
{
2727
try {
28-
if (!$this->filesystem->has(\sprintf('dataflow-job-%s.log', $jobId))) {
28+
if (!$this->filesystem->fileExists(\sprintf('dataflow-job-%s.log', $jobId))) {
2929
return [];
3030
}
3131

0 commit comments

Comments
 (0)