Skip to content

Commit f3bc39e

Browse files
authored
fix(processor): remove resumable from the main interface (#4684)
1 parent 8d1e1d2 commit f3bc39e

File tree

6 files changed

+1
-36
lines changed

6 files changed

+1
-36
lines changed

src/Doctrine/Common/State/Processor.php

-5
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ public function __construct(ManagerRegistry $managerRegistry)
3131
$this->managerRegistry = $managerRegistry;
3232
}
3333

34-
public function resumable(?string $operationName = null, array $context = []): bool
35-
{
36-
return false;
37-
}
38-
3934
public function supports($data, array $identifiers = [], ?string $operationName = null, array $context = []): bool
4035
{
4136
return null !== $this->getManager($data);

src/State/ChainProcessor.php

-11
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,6 @@ public function __construct(iterable $processors)
3535
$this->processors = $processors;
3636
}
3737

38-
public function resumable(?string $operationName = null, array $context = []): bool
39-
{
40-
foreach ($this->processors as $processor) {
41-
if ($processor->resumable($operationName, $context)) {
42-
return $processor->resumable($operationName, $context);
43-
}
44-
}
45-
46-
return false;
47-
}
48-
4938
public function supports($data, array $identifiers = [], ?string $operationName = null, array $context = []): bool
5039
{
5140
foreach ($this->processors as $processor) {

src/State/ProcessorInterface.php

-6
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@
2020
*/
2121
interface ProcessorInterface
2222
{
23-
/**
24-
* Should we continue calling the next Processor or stop after this one?
25-
* Defaults to stop the ChainProcessor if this interface is not implemented.
26-
*/
27-
public function resumable(?string $operationName = null, array $context = []): bool;
28-
2923
/**
3024
* Whether this state handler supports the class/identifier tuple.
3125
*

src/Symfony/Bundle/Processor/TraceableChainProcessor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private function traceProcessors($data, array $context = [])
4242
if (
4343
($this->processorsResponse[\get_class($processor)] = $found ? false : $processor->supports($data, $context))
4444
&&
45-
!($processor instanceof ProcessorInterface && $processor->resumable()) && !$found
45+
!$found
4646
) {
4747
$found = true;
4848
}

src/Symfony/Messenger/Processor.php

-5
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,6 @@ private function remove($data, array $context = [])
6767
);
6868
}
6969

70-
public function resumable(?string $operationName = null, array $context = []): bool
71-
{
72-
return false;
73-
}
74-
7570
public function process($data, array $identifiers = [], ?string $operationName = null, array $context = [])
7671
{
7772
if (\array_key_exists('operation', $context) && $context['operation']->isDelete()) {

tests/Symfony/Messenger/ProcessorTest.php

-8
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@ public function testSupport()
5151
$this->assertTrue($processor->supports(new Dummy(), [], 'create'));
5252
}
5353

54-
public function testResumable()
55-
{
56-
$metadataFactoryProphecy = $this->prophesize(ResourceMetadataCollectionFactoryInterface::class);
57-
58-
$processor = new Processor($metadataFactoryProphecy->reveal(), $this->prophesize(MessageBusInterface::class)->reveal());
59-
$this->assertFalse($processor->resumable());
60-
}
61-
6254
public function testSupportWithContext()
6355
{
6456
$resourceMetadataFactoryProphecy = $this->prophesize(ResourceMetadataCollectionFactoryInterface::class);

0 commit comments

Comments
 (0)