diff --git a/src/Doctrine/EventListener/PublishMercureUpdatesListener.php b/src/Doctrine/EventListener/PublishMercureUpdatesListener.php index b6182ef29ac..7ced9f2a1e8 100644 --- a/src/Doctrine/EventListener/PublishMercureUpdatesListener.php +++ b/src/Doctrine/EventListener/PublishMercureUpdatesListener.php @@ -85,7 +85,7 @@ public function __construct(LegacyResourceClassResolverInterface|ResourceClassRe $this->expressionLanguage->addFunction($rawurlencode); $this->expressionLanguage->addFunction( - new ExpressionFunction('getOperation', static fn (string $apiResource, string $name): string => sprintf('getOperation(%s, %s)', $apiResource, $name), static fn (array $arguments, $apiResource, string $name): Operation => $resourceMetadataFactory->create($resourceClassResolver->getResourceClass($apiResource))->getOperation($name)) + new ExpressionFunction('get_operation', static fn (string $apiResource, string $name): string => sprintf('getOperation(%s, %s)', $apiResource, $name), static fn (array $arguments, $apiResource, string $name): Operation => $resourceMetadataFactory->create($resourceClassResolver->getResourceClass($apiResource))->getOperation($name)) ); $this->expressionLanguage->addFunction( new ExpressionFunction('iri', static fn (string $apiResource, int $referenceType = UrlGeneratorInterface::ABS_URL, ?string $operation = null): string => sprintf('iri(%s, %d, %s)', $apiResource, $referenceType, $operation), static fn (array $arguments, $apiResource, int $referenceType = UrlGeneratorInterface::ABS_URL, $operation = null): string => $iriConverter->getIriFromResource($apiResource, $referenceType, $operation)) diff --git a/tests/Doctrine/EventListener/PublishMercureUpdatesListenerTest.php b/tests/Doctrine/EventListener/PublishMercureUpdatesListenerTest.php index ec032893eb8..e4e29293b06 100644 --- a/tests/Doctrine/EventListener/PublishMercureUpdatesListenerTest.php +++ b/tests/Doctrine/EventListener/PublishMercureUpdatesListenerTest.php @@ -177,7 +177,7 @@ public function testPublishUpdateMultipleTopicsUsingExpressionLanguage(): void 'topics' => [ '@=iri(object)', '@=iri(object, '.UrlGeneratorInterface::ABS_PATH.')', - '@=iri(object, '.UrlGeneratorInterface::ABS_URL.', getOperation(object, "/custom_resource/mercure_with_topics_and_get_operations/{id}{._format}"))', + '@=iri(object, '.UrlGeneratorInterface::ABS_URL.', get_operation(object, "/custom_resource/mercure_with_topics_and_get_operations/{id}{._format}"))', ], ]; diff --git a/tests/Fixtures/TestBundle/Document/MercureWithTopicsAndGetOperation.php b/tests/Fixtures/TestBundle/Document/MercureWithTopicsAndGetOperation.php index 0447b030c6a..427476ada47 100644 --- a/tests/Fixtures/TestBundle/Document/MercureWithTopicsAndGetOperation.php +++ b/tests/Fixtures/TestBundle/Document/MercureWithTopicsAndGetOperation.php @@ -28,7 +28,7 @@ mercure: [ 'topics' => [ '@=iri(object)', - '@=iri(object, '.UrlGeneratorInterface::ABS_URL.', getOperation(object, "/custom_resource/mercure_with_topics_and_get_operations/{id}{._format}"))', + '@=iri(object, '.UrlGeneratorInterface::ABS_URL.', get_operation(object, "/custom_resource/mercure_with_topics_and_get_operations/{id}{._format}"))', ], ] )] diff --git a/tests/Fixtures/TestBundle/Entity/MercureWithTopicsAndGetOperation.php b/tests/Fixtures/TestBundle/Entity/MercureWithTopicsAndGetOperation.php index 4556c4b549e..929fee7e239 100644 --- a/tests/Fixtures/TestBundle/Entity/MercureWithTopicsAndGetOperation.php +++ b/tests/Fixtures/TestBundle/Entity/MercureWithTopicsAndGetOperation.php @@ -28,7 +28,7 @@ mercure: [ 'topics' => [ '@=iri(object)', - '@=iri(object, '.UrlGeneratorInterface::ABS_URL.', getOperation(object, "/custom_resource/mercure_with_topics_and_get_operations/{id}{._format}"))', + '@=iri(object, '.UrlGeneratorInterface::ABS_URL.', get_operation(object, "/custom_resource/mercure_with_topics_and_get_operations/{id}{._format}"))', ], ] )]