1 | <?php |
||
20 | abstract class Loader implements LoaderInterface |
||
21 | { |
||
22 | protected $resolver; |
||
23 | protected $loaders = array(); |
||
24 | |||
25 | /** |
||
26 | * Loads a resource. |
||
27 | * |
||
28 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
||
29 | * @param string $resource File name |
||
30 | * @param string $type The resource type |
||
31 | * |
||
32 | * @return array |
||
33 | */ |
||
34 | 32 | public function load($resource, $type = null) |
|
38 | |||
39 | /** |
||
40 | * Gets the loader resolver. |
||
41 | * |
||
42 | * @return LoaderResolverInterface A LoaderResolverInterface instance |
||
43 | */ |
||
44 | 1 | public function getResolver() |
|
48 | |||
49 | /** |
||
50 | * Sets the loader resolver. |
||
51 | * |
||
52 | * @param LoaderResolverInterface $resolver A LoaderResolverInterface instance |
||
53 | */ |
||
54 | 11 | public function setResolver(LoaderResolverInterface $resolver) |
|
58 | |||
59 | /** |
||
60 | * Adds an array loader. |
||
61 | * |
||
62 | * @param ArrayLoaderInterface $loader |
||
63 | * |
||
64 | * @return Loader |
||
65 | */ |
||
66 | 7 | public function addLoader(ArrayLoaderInterface $loader) |
|
72 | |||
73 | /** |
||
74 | * Adds array loaders. |
||
75 | * |
||
76 | * @param array $loaders |
||
77 | * |
||
78 | * @return Loader |
||
79 | */ |
||
80 | 2 | public function addLoaders(array $loaders) |
|
88 | |||
89 | /** |
||
90 | * Loads internal processing. |
||
91 | * |
||
92 | * @param string $file |
||
93 | * |
||
94 | * @return array|\SimpleXMLElement |
||
95 | */ |
||
96 | abstract protected function loadFile($file); |
||
97 | } |
||
98 |