schema
3 years ago
AbstractLoader.php
4 years ago
AnnotationLoader.php
1 year ago
AutoMappingTrait.php
1 year ago
FileLoader.php
4 years ago
FilesLoader.php
4 years ago
LoaderChain.php
4 years ago
LoaderInterface.php
4 years ago
PropertyInfoLoader.php
1 year ago
StaticMethodLoader.php
4 years ago
XmlFileLoader.php
4 years ago
XmlFilesLoader.php
4 years ago
YamlFileLoader.php
4 years ago
YamlFilesLoader.php
4 years ago
index.php
3 years ago
LoaderChain.php
31 lines
| 1 | <?php |
| 2 | namespace MailPoetVendor\Symfony\Component\Validator\Mapping\Loader; |
| 3 | if (!defined('ABSPATH')) exit; |
| 4 | use MailPoetVendor\Symfony\Component\Validator\Exception\MappingException; |
| 5 | use MailPoetVendor\Symfony\Component\Validator\Mapping\ClassMetadata; |
| 6 | class LoaderChain implements LoaderInterface |
| 7 | { |
| 8 | protected $loaders; |
| 9 | public function __construct(array $loaders) |
| 10 | { |
| 11 | foreach ($loaders as $loader) { |
| 12 | if (!$loader instanceof LoaderInterface) { |
| 13 | throw new MappingException(\sprintf('Class "%s" is expected to implement LoaderInterface.', \get_debug_type($loader))); |
| 14 | } |
| 15 | } |
| 16 | $this->loaders = $loaders; |
| 17 | } |
| 18 | public function loadClassMetadata(ClassMetadata $metadata) |
| 19 | { |
| 20 | $success = \false; |
| 21 | foreach ($this->loaders as $loader) { |
| 22 | $success = $loader->loadClassMetadata($metadata) || $success; |
| 23 | } |
| 24 | return $success; |
| 25 | } |
| 26 | public function getLoaders() |
| 27 | { |
| 28 | return $this->loaders; |
| 29 | } |
| 30 | } |
| 31 |