Skip to content

Commit 8d6b666

Browse files
committed
feature #31764 [FrameworkBundle] add attribute stamps (walidboughdiri)
This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle] add attribute stamps | Q | A | ------------- | --- | Branch? | 4.4 <!-- see below --> | Bug fix? | no | New feature? | yes<!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | n/a <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | n/a <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/roadmap): - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against branch 4.4. - Legacy code removals go to the master branch. --> Commits ------- 8a09579d35 remove bc break code
2 parents b2376f0 + d9b0116 commit 8d6b666

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Controller/ControllerTrait.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
2929
use Symfony\Component\HttpKernel\HttpKernelInterface;
3030
use Symfony\Component\Messenger\Envelope;
31+
use Symfony\Component\Messenger\Stamp\StampInterface;
3132
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
3233
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
3334
use Symfony\Component\Security\Csrf\CsrfToken;
@@ -397,18 +398,19 @@ protected function isCsrfTokenValid(string $id, ?string $token): bool
397398
/**
398399
* Dispatches a message to the bus.
399400
*
400-
* @param object|Envelope $message The message or the message pre-wrapped in an envelope
401+
* @param object|Envelope $message The message or the message pre-wrapped in an envelope
402+
* @param StampInterface[] $stamps
401403
*
402404
* @final
403405
*/
404-
protected function dispatchMessage($message): Envelope
406+
protected function dispatchMessage($message, array $stamps = []): Envelope
405407
{
406408
if (!$this->container->has('messenger.default_bus')) {
407409
$message = class_exists(Envelope::class) ? 'You need to define the "messenger.default_bus" configuration option.' : 'Try running "composer require symfony/messenger".';
408410
throw new \LogicException('The message bus is not enabled in your application. '.$message);
409411
}
410412

411-
return $this->container->get('messenger.default_bus')->dispatch($message);
413+
return $this->container->get('messenger.default_bus')->dispatch($message, $stamps);
412414
}
413415

414416
/**

0 commit comments

Comments
 (0)