Skip to content

Commit 3a527fd

Browse files
Merge branch '5.4' into 6.2
* 5.4: [FrameworkBundle] Fix Workflow without a marking store definition uses marking store definition of previously defined workflow [HttpFoundation] UrlHelper is now aware of RequestContext changes UrlHelper is now aware of RequestContext changes [Process] Stop the process correctly even if underlying input stream is not closed: [Notifier] Update AmazonSns url in doc from de to en [PropertyInfo] Fix `PhpStanExtractor` when constructor has no docblock
2 parents 11b6488 + 3e9eeab commit 3a527fd

File tree

4 files changed

+60
-3
lines changed

4 files changed

+60
-3
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,7 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $
970970
$definitionDefinition->addArgument(new Reference(sprintf('%s.metadata_store', $workflowId)));
971971

972972
// Create MarkingStore
973+
$markingStoreDefinition = null;
973974
if (isset($workflow['marking_store']['type'])) {
974975
$markingStoreDefinition = new ChildDefinition('workflow.marking_store.method');
975976
$markingStoreDefinition->setArguments([
@@ -983,7 +984,7 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $
983984
// Create Workflow
984985
$workflowDefinition = new ChildDefinition(sprintf('%s.abstract', $type));
985986
$workflowDefinition->replaceArgument(0, new Reference(sprintf('%s.definition', $workflowId)));
986-
$workflowDefinition->replaceArgument(1, $markingStoreDefinition ?? null);
987+
$workflowDefinition->replaceArgument(1, $markingStoreDefinition);
987988
$workflowDefinition->replaceArgument(3, $name);
988989
$workflowDefinition->replaceArgument(4, $workflow['events_to_dispatch']);
989990

Resources/config/services.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class_exists(WorkflowEvents::class) ? WorkflowEvents::ALIASES : []
120120
->set('url_helper', UrlHelper::class)
121121
->args([
122122
service('request_stack'),
123-
service('router.request_context')->ignoreOnInvalid(),
123+
service('router')->ignoreOnInvalid(),
124124
])
125125
->alias(UrlHelper::class, 'url_helper')
126126

Tests/DependencyInjection/PhpFrameworkExtensionTest.php

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,62 @@ public function testWorkflowValidationStateMachine()
8888
});
8989
}
9090

91+
public function testWorkflowDefaultMarkingStoreDefinition()
92+
{
93+
$container = $this->createContainerFromClosure(function ($container) {
94+
$container->loadFromExtension('framework', [
95+
'workflows' => [
96+
'workflow_a' => [
97+
'type' => 'state_machine',
98+
'marking_store' => [
99+
'type' => 'method',
100+
'property' => 'status',
101+
],
102+
'supports' => [
103+
__CLASS__,
104+
],
105+
'places' => [
106+
'a',
107+
'b',
108+
],
109+
'transitions' => [
110+
'a_to_b' => [
111+
'from' => ['a'],
112+
'to' => ['b'],
113+
],
114+
],
115+
],
116+
'workflow_b' => [
117+
'type' => 'state_machine',
118+
'supports' => [
119+
__CLASS__,
120+
],
121+
'places' => [
122+
'a',
123+
'b',
124+
],
125+
'transitions' => [
126+
'a_to_b' => [
127+
'from' => ['a'],
128+
'to' => ['b'],
129+
],
130+
],
131+
],
132+
],
133+
]);
134+
});
135+
136+
$workflowA = $container->getDefinition('state_machine.workflow_a');
137+
$argumentsA = $workflowA->getArguments();
138+
$this->assertArrayHasKey('index_1', $argumentsA, 'workflow_a has a marking_store argument');
139+
$this->assertNotNull($argumentsA['index_1'], 'workflow_a marking_store argument is not null');
140+
141+
$workflowB = $container->getDefinition('state_machine.workflow_b');
142+
$argumentsB = $workflowB->getArguments();
143+
$this->assertArrayHasKey('index_1', $argumentsB, 'workflow_b has a marking_store argument');
144+
$this->assertNull($argumentsB['index_1'], 'workflow_b marking_store argument is null');
145+
}
146+
91147
public function testRateLimiterWithLockFactory()
92148
{
93149
try {

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"symfony/deprecation-contracts": "^2.1|^3",
2626
"symfony/error-handler": "^6.1",
2727
"symfony/event-dispatcher": "^5.4|^6.0",
28-
"symfony/http-foundation": "^6.2",
28+
"symfony/http-foundation": "^6.2.11",
2929
"symfony/http-kernel": "^6.2.1",
3030
"symfony/polyfill-mbstring": "~1.0",
3131
"symfony/filesystem": "^5.4|^6.0",

0 commit comments

Comments
 (0)