1 | <?php |
||
17 | class Configuration implements LoggerAwareInterface |
||
18 | { |
||
19 | const DEFAULT_NAME = '_config.yml'; |
||
20 | |||
21 | /** |
||
22 | * A list of regular expressions or files directly related to stakx websites that should not be copied over to the |
||
23 | * compiled website as an asset. |
||
24 | * |
||
25 | * @var array |
||
26 | */ |
||
27 | public static $stakxSourceFiles = array('/^_(?!themes).*/', '/.twig$/'); |
||
28 | |||
29 | /** |
||
30 | * An array representation of the main Yaml configuration. |
||
31 | * |
||
32 | * @var array |
||
33 | */ |
||
34 | private $configuration; |
||
35 | |||
36 | /** |
||
37 | * @var LoggerInterface |
||
38 | */ |
||
39 | private $output; |
||
40 | |||
41 | /** |
||
42 | * @var Filesystem |
||
43 | */ |
||
44 | private $fs; |
||
|
|||
45 | |||
46 | /** |
||
47 | * Configuration constructor. |
||
48 | */ |
||
49 | 30 | public function __construct() |
|
54 | |||
55 | /** |
||
56 | * Parse a given configuration file and configure this Configuration instance. |
||
57 | * |
||
58 | * This function should be called with 'null' passed when "configuration-less" mode is used |
||
59 | * |
||
60 | * @param string|null $configFile The path to the configuration file. If null, the default configuration will be |
||
61 | * used |
||
62 | */ |
||
63 | 30 | public function parseConfiguration($configFile = null) |
|
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | 17 | public function setLogger(LoggerInterface $logger) |
|
91 | |||
92 | 14 | public function isDebug() |
|
96 | |||
97 | /** |
||
98 | * @TODO 1.0.0 Remove support for 'base' in next major release; it has been replaced by 'baseurl' |
||
99 | * |
||
100 | * @return mixed|null |
||
101 | */ |
||
102 | 4 | public function getBaseUrl() |
|
114 | |||
115 | /** |
||
116 | * @return string[] |
||
117 | */ |
||
118 | 1 | public function getDataFolders() |
|
122 | |||
123 | /** |
||
124 | * @return string[] |
||
125 | */ |
||
126 | 1 | public function getDataSets() |
|
130 | |||
131 | 1 | public function getIncludes() |
|
135 | |||
136 | 1 | public function getExcludes() |
|
140 | |||
141 | 14 | public function getTheme() |
|
145 | |||
146 | 1 | public function getConfiguration() |
|
150 | |||
151 | 1 | public function getPageViewFolders() |
|
155 | |||
156 | 3 | public function getTargetFolder() |
|
160 | |||
161 | 1 | public function getCollectionsFolders() |
|
165 | |||
166 | 14 | public function getTwigAutoescape() |
|
170 | |||
171 | public function getRedirectTemplate() |
||
175 | |||
176 | /** |
||
177 | * Return the specified configuration option if available, otherwise return the default. |
||
178 | * |
||
179 | * @param string $name The configuration option to lookup |
||
180 | * @param mixed|null $default The default value returned if the configuration option isn't found |
||
181 | * |
||
182 | * @return mixed|null |
||
183 | */ |
||
184 | 30 | private function returnConfigOption($name, $default = null) |
|
188 | |||
189 | 30 | private function defaultConfiguration() |
|
212 | |||
213 | 30 | private function handleDeprecations() |
|
223 | } |
||
224 |
Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.