transparent-email/src/ServiceCollector.php
2024-01-23 12:36:03 +03:00

28 lines
524 B
PHP

<?php
declare(strict_types=1);
namespace bkrukowski\TransparentEmail;
use bkrukowski\TransparentEmail\Services\ServiceInterface;
class ServiceCollector implements ServiceCollectorInterface
{
private $services = [];
public function addService(ServiceInterface $service): void
{
$this->services[] = $service;
}
/**
* {@inheritdoc}
*/
public function getIterator(): \Traversable
{
foreach ($this->services as $service) {
yield $service;
}
}
}