1 | <?php |
||
25 | abstract class AbstractLoader implements LoaderInterface |
||
26 | { |
||
27 | |||
28 | /** |
||
29 | * Load the configuration from an URI. |
||
30 | * |
||
31 | * @since 0.4.0 |
||
32 | * |
||
33 | * @param string $uri URI of the resource to load. |
||
34 | * |
||
35 | * @return array|null Data contained within the resource. Null if no data could be loaded/parsed. |
||
36 | * @throws FailedToLoadConfigException If the configuration could not be loaded. |
||
37 | */ |
||
38 | 1 | public function load($uri) |
|
57 | |||
58 | /** |
||
59 | * Validate and return the URI. |
||
60 | * |
||
61 | * @since 0.4.0 |
||
62 | * |
||
63 | * @param string $uri URI of the resource to load. |
||
64 | * |
||
65 | * @return string Validated URI. |
||
66 | */ |
||
67 | protected function validateUri($uri) |
||
71 | |||
72 | /** |
||
73 | * Parse the raw data and return it in parsed form. |
||
74 | * |
||
75 | * @since 0.4.0 |
||
76 | * |
||
77 | * @param array|null $data Raw data to be parsed. |
||
78 | * |
||
79 | * @return array|null Data in parsed form. Null if no parsable data found. |
||
80 | */ |
||
81 | 1 | protected function parseData($data) |
|
85 | |||
86 | /** |
||
87 | * Load the contents of an resource identified by an URI. |
||
88 | * |
||
89 | * @since 0.4.0 |
||
90 | * |
||
91 | * @param string $uri URI of the resource. |
||
92 | * |
||
93 | * @return array|null Raw data loaded from the resource. Null if no data found. |
||
94 | */ |
||
95 | abstract protected function loadUri($uri); |
||
96 | } |
||
97 |