Skip to content

Instantly share code, notes, and snippets.

@dgafka
Last active May 13, 2022 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgafka/b6d2f7de1188482b055da6cbbfb55f9c to your computer and use it in GitHub Desktop.
Save dgafka/b6d2f7de1188482b055da6cbbfb55f9c to your computer and use it in GitHub Desktop.
asynchronous-messaging-07.php
<?php
class AddExecutorIdInterceptor
{
#[Before(pointcut: CommandHandler::class, changeHeaders: true)]
public function addExecutorId(PlaceOrder $payload, array $headers): array
{
// changeHeaders: true/false allows for changing headers or payload.
// you don't need to pass parameters, if you don't want to use them.
// returning null means stop execution.
return ["executorId" => $id];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment