Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7e9d5bb

Browse filesBrowse files
committed
[TwigBridge] Remove obsolete Workflow feature detection
1 parent fee9b30 commit 7e9d5bb
Copy full SHA for 7e9d5bb

File tree

1 file changed

+9
-16
lines changed
Filter options

1 file changed

+9
-16
lines changed

‎src/Symfony/Bridge/Twig/Tests/Extension/WorkflowExtensionTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Tests/Extension/WorkflowExtensionTest.php
+9-16Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Symfony\Component\Workflow\MarkingStore\MethodMarkingStore;
1818
use Symfony\Component\Workflow\Metadata\InMemoryMetadataStore;
1919
use Symfony\Component\Workflow\Registry;
20-
use Symfony\Component\Workflow\SupportStrategy\ClassInstanceSupportStrategy;
2120
use Symfony\Component\Workflow\SupportStrategy\InstanceOfSupportStrategy;
2221
use Symfony\Component\Workflow\Transition;
2322
use Symfony\Component\Workflow\TransitionBlockerList;
@@ -36,25 +35,19 @@ protected function setUp(): void
3635
new Transition('t2', 'waiting_for_payment', 'processed'),
3736
];
3837

39-
$metadataStore = null;
40-
if (class_exists(InMemoryMetadataStore::class)) {
41-
$transitionsMetadata = new \SplObjectStorage();
42-
$transitionsMetadata->attach($this->t1, ['title' => 't1 title']);
43-
$metadataStore = new InMemoryMetadataStore(
44-
['title' => 'workflow title'],
45-
['orderer' => ['title' => 'ordered title']],
46-
$transitionsMetadata
47-
);
48-
}
38+
$transitionsMetadata = new \SplObjectStorage();
39+
$transitionsMetadata->attach($this->t1, ['title' => 't1 title']);
40+
$metadataStore = new InMemoryMetadataStore(
41+
['title' => 'workflow title'],
42+
['orderer' => ['title' => 'ordered title']],
43+
$transitionsMetadata
44+
);
4945
$definition = new Definition($places, $transitions, null, $metadataStore);
5046
$workflow = new Workflow($definition, new MethodMarkingStore());
5147

5248
$registry = new Registry();
53-
$addWorkflow = method_exists($registry, 'addWorkflow') ? 'addWorkflow' : 'add';
54-
$supportStrategy = class_exists(InstanceOfSupportStrategy::class)
55-
? new InstanceOfSupportStrategy(Subject::class)
56-
: new ClassInstanceSupportStrategy(Subject::class);
57-
$registry->$addWorkflow($workflow, $supportStrategy);
49+
$supportStrategy = new InstanceOfSupportStrategy(Subject::class);
50+
$registry->addWorkflow($workflow, $supportStrategy);
5851
$this->extension = new WorkflowExtension($registry);
5952
}
6053

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.