Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/validator/Mapping/Loader/FilesLoader.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | 129ea1e6d783 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 /* | |
4 * This file is part of the Symfony package. | |
5 * | |
6 * (c) Fabien Potencier <fabien@symfony.com> | |
7 * | |
8 * For the full copyright and license information, please view the LICENSE | |
9 * file that was distributed with this source code. | |
10 */ | |
11 | |
12 namespace Symfony\Component\Validator\Mapping\Loader; | |
13 | |
14 /** | |
15 * Base loader for loading validation metadata from a list of files. | |
16 * | |
17 * @author Bulat Shakirzyanov <mallluhuct@gmail.com> | |
18 * @author Bernhard Schussek <bschussek@gmail.com> | |
19 * | |
20 * @see YamlFilesLoader | |
21 * @see XmlFilesLoader | |
22 */ | |
23 abstract class FilesLoader extends LoaderChain | |
24 { | |
25 /** | |
26 * Creates a new loader. | |
27 * | |
28 * @param array $paths An array of file paths | |
29 */ | |
30 public function __construct(array $paths) | |
31 { | |
32 parent::__construct($this->getFileLoaders($paths)); | |
33 } | |
34 | |
35 /** | |
36 * Returns an array of file loaders for the given file paths. | |
37 * | |
38 * @param array $paths An array of file paths | |
39 * | |
40 * @return LoaderInterface[] The metadata loaders | |
41 */ | |
42 protected function getFileLoaders($paths) | |
43 { | |
44 $loaders = array(); | |
45 | |
46 foreach ($paths as $path) { | |
47 $loaders[] = $this->getFileLoaderInstance($path); | |
48 } | |
49 | |
50 return $loaders; | |
51 } | |
52 | |
53 /** | |
54 * Creates a loader for the given file path. | |
55 * | |
56 * @param string $path The file path | |
57 * | |
58 * @return LoaderInterface The created loader | |
59 */ | |
60 abstract protected function getFileLoaderInstance($path); | |
61 } |