You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-05 12:32:55 +01:00
19 lines
421 B
PHP
19 lines
421 B
PHP
<?php
|
|
|
|
namespace Flasher\Prime\Middleware;
|
|
|
|
use Flasher\Prime\Envelope;
|
|
use Flasher\Prime\Stamp\HopsStamp;
|
|
|
|
final class AddHopsStampMiddleware implements MiddlewareInterface
|
|
{
|
|
public function handle(Envelope $envelope, callable $next)
|
|
{
|
|
if (null === $envelope->get('Flasher\Prime\Stamp\HopsStamp')) {
|
|
$envelope->withStamp(new HopsStamp(1));
|
|
}
|
|
|
|
return $next($envelope);
|
|
}
|
|
}
|