for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Bankiru\Seo\Resolver;
use Bankiru\Seo\SourceInterface;
final class SourceRegistry
{
/** @var SourceInterface[] */
private $sources = [];
/**
* @return SourceInterface[]
*/
public function all()
return $this->sources;
}
* @param string $key
* @param SourceInterface $source
public function add($key, SourceInterface $source)
$this->sources[$key] = $source;
*
* @return bool
public function has($key)
return array_key_exists($key, $this->sources);
* @return SourceInterface
* @throws \OutOfBoundsException
public function get($key)
if (!$this->has($key)) {
throw new \OutOfBoundsException('Source not found: '.$key);
return $this->sources[$key];