for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Created by PhpStorm.
* User: batanov.pavel
* Date: 16.02.2016
* Time: 8:49
*/
namespace Bankiru\Api\Rpc\Routing;
class LoaderResolver implements LoaderResolverInterface
{
* @var LoaderInterface[] An array of LoaderInterface objects
private $loaders = array();
* Constructor.
*
* @param LoaderInterface[] $loaders An array of loaders
public function __construct(array $loaders = array())
foreach ($loaders as $loader) {
$this->addLoader($loader);
}
* {@inheritdoc}
public function resolve($resource, $type = null)
foreach ($this->loaders as $loader) {
if ($loader->supports($resource, $type)) {
return $loader;
return false;
* Adds a loader.
* @param LoaderInterface $loader A LoaderInterface instance
public function addLoader(LoaderInterface $loader)
$this->loaders[] = $loader;
* Returns the registered loaders.
* @return LoaderInterface[] An array of LoaderInterface instances
public function getLoaders()
return $this->loaders;