Skip to content

Commit 56973cf

Browse files
[UPMERGE] 1.13 -> 1.14 (#1042)
This PR has been generated automatically. For more details see [upmerge_pr.yaml](/Sylius/SyliusResourceBundle/blob/1.13/.github/workflows/upmerge_pr.yaml). **Remember!** The upmerge should always be merged with using `Merge pull request` button. In case of conflicts, please resolve them manually with usign the following commands: ``` git fetch upstream gh pr checkout <this-pr-number> git merge upstream/1.14 -m "Resolve conflicts between 1.13 and 1.14" ``` If you use other name for the upstream remote, please replace `upstream` with the name of your remote pointing to the `Sylius/SyliusResourceBundle` repository. Once the conflicts are resolved, please run `git merge --continue` and push the changes to this PR.
2 parents 93dae9a + 19f758a commit 56973cf

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/Component/src/Metadata/ApplyStateMachineTransition.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function __construct(
3737
?bool $validate = null,
3838
?string $formType = null,
3939
?array $formOptions = null,
40+
?string $eventShortName = null,
4041
?string $notificationMessage = null,
4142
string|\Stringable|null $security = null,
4243
?string $securityMessage = null,
@@ -63,6 +64,7 @@ public function __construct(
6364
validate: $validate ?? false,
6465
formType: $formType,
6566
formOptions: $formOptions,
67+
eventShortName: $eventShortName,
6668
notificationMessage: $notificationMessage,
6769
security: $security,
6870
securityMessage: $securityMessage,

src/Component/src/Metadata/Resource/Factory/EventShortNameResourceMetadataCollectionFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function create(string $resourceClass): ResourceMetadataCollection
4040
/** @var string $key */
4141
$key = $operation->getName();
4242

43-
$operations->add($key, $this->addDefaults($resource, $operation));
43+
$operations->add($key, $this->addDefaults($operation));
4444
}
4545

4646
$resource = $resource->withOperations($operations);
@@ -51,7 +51,7 @@ public function create(string $resourceClass): ResourceMetadataCollection
5151
return $resourceCollectionMetadata;
5252
}
5353

54-
private function addDefaults(ResourceMetadata $resource, Operation $operation): Operation
54+
private function addDefaults(Operation $operation): Operation
5555
{
5656
if (null === $operation->getEventShortName()) {
5757
$shortName = $operation instanceof ApplyStateMachineTransition ? ResourceActions::UPDATE : $operation->getShortName() ?? '';

src/Component/tests/Metadata/Resource/Factory/EventShortNameResourceMetadataCollectionFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function testItConfiguresDefaultEventShortNameOnOperations(): void
5151

5252
$create = (new Create(name: 'app_book_create'))->withResource($resource);
5353
$show = (new Show(name: 'app_book_show'))->withResource($resource);
54-
$applyStateMachineTransition = (new ApplyStateMachineTransition(name: 'app_book_publish'))->withResource($resource);
54+
$applyStateMachineTransition = (new ApplyStateMachineTransition(name: 'app_book_publish', stateMachineTransition: 'publish'))->withResource($resource);
5555
$bulkDelete = (new BulkDelete(name: 'app_book_bulk_delete'))->withResource($resource);
5656

5757
$resource = $resource->withOperations(new Operations([

0 commit comments

Comments
 (0)