transparent-email/src/ServiceCollector.php

27 lines
501 B
PHP
Raw Normal View History

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