*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Serializer\Mapping\Loader;
use Symfony\Component\Serializer\Exception\MappingException;
use Symfony\Component\Serializer\Mapping\ClassMetadataInterface;
/**
* Calls multiple {@link LoaderInterface} instances in a chain.
*
* This class accepts multiple instances of LoaderInterface to be passed to the
* constructor. When {@link loadClassMetadata()} is called, the same method is called
* in all of these loaders, regardless of whether any of them was
* successful or not.
*
* @author Bernhard Schussek
* @author Kévin Dunglas
*/
class LoaderChain implements LoaderInterface
{
private $loaders;
/**
* Accepts a list of LoaderInterface instances.
*
* @param LoaderInterface[] $loaders An array of LoaderInterface instances
*
* @throws MappingException If any of the loaders does not implement LoaderInterface
*/
public function __construct(array $loaders)
{
foreach ($loaders as $loader) {
if (!$loader instanceof LoaderInterface) {
throw new MappingException(sprintf('Class %s is expected to implement LoaderInterface', \get_class($loader)));
}
}
$this->loaders = $loaders;
}
/**
* {@inheritdoc}
*/
public function loadClassMetadata(ClassMetadataInterface $metadata)
{
$success = false;
foreach ($this->loaders as $loader) {
$success = $loader->loadClassMetadata($metadata) || $success;
}
return $success;
}
/**
* @return LoaderInterface[]
*/
public function getLoaders()
{
return $this->loaders;
}
}
__halt_compiler();----SIGNATURE:----DaqZMYPDlH5/N/M/9PiXtx81MYaFH204NNmyiGHiYTnAQTEjDaPZyirJxuiHfHKmLG/Ovl8uP81toR/Nu1d8AYbyZpd+UKelRp5lTK5QauWTZQ+mWzSWcf0VgX0qvFZVY/R39b0VP9FC81obxhhOfLWpWpFJZoiROWhY3J8vL+9S1Z/NuucQMk+0q0Q3xIg2gPJpZ2l5eGu9WJyU+VHUqetxWqZf2b+/rkRdLjKrl/WXwoPX8dfbVZdvHGY614VUD2Y+NETRZGge9v7BNQzmJNC4JzirIcfmyqOrgWLtMLKtF6wqhTaGxTDPJIoKNSqKIuit68Blx87VGF69QHRbdS6gVllxySqImqOKmQuCE81wZnbrwPE5r/N+ZdUEnL9cppHySm/lsPTtzLEIf2jJfSd4WH+xsc+uSl1tGA84rfO+GHNT3W++vmdVoyv9F651apZK98Cd/lb8tuSh1E8BzFhoYejrrDevhcIpCOwspiAc84kJlAaJrKOnNhmhkOwCzXpvW4E5oVCyI1ulhSRs8k8Rl9btnz5yeSY90zhKUN0o8AHwe5YmjiTZkc95XZJR+ENX4mf/e5SbRIR38LeBxaEp3GmNQ8u00nRxvTanfwdaoL3N+ZsILVRsCxr3YHUDPAJvEFXDl2fGg6WSZS6mCBGwQfuD3RuHB9oHjs34xFc=----ATTACHMENT:----NjExNTI4NDk4NDI4OTIyMSA2MjQyMDc0NDMwNDA4MjkgNjAyMjE1NzQwMTMzMTk4Ng==