dbmsv3/app/Processors/Customer/Service/ServiceComposite.php
2025-10-30 17:54:08 +09:00

25 lines
460 B
PHP

<?php
namespace App\Processors\Customer;
use App\Processor\Customer\ServiceInterface;
use App\Processors\Customer\ServiceContext;
class ServiceComposite implements ServiceInterface
{
private array $pipes;
public function __construct(array $pipes)
{
$this->pipes = $pipes;
}
public function process(ServiceContext $ctx): ServiceContext
{
foreach ($this->pipes as $pipe) {
$ctx = $pipe->process($ctx);
}
return $ctx;
}
}