1 | <?php |
||
15 | final class Configuration |
||
16 | { |
||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | const DEFAULT_POST_ROUTE = 'blog/:year/:month/:day/:title'; |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | private $globalVariables = []; |
||
26 | |||
27 | 11 | /** |
|
28 | * @var YamlAndNeonParser |
||
29 | 11 | */ |
|
30 | 11 | private $yamlAndNeonParser; |
|
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | 3 | private $sourceDirectory; |
|
36 | |||
37 | 3 | /** |
|
38 | 2 | * @var string |
|
39 | 2 | */ |
|
40 | private $outputDirectory; |
||
41 | 3 | ||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | private $postRoute = self::DEFAULT_POST_ROUTE; |
||
46 | |||
47 | 2 | public function __construct(YamlAndNeonParser $yamlAndNeonParser) |
|
51 | |||
52 | 9 | /** |
|
53 | * @param SplFileInfo[] $files |
||
54 | 9 | */ |
|
55 | public function loadFromFiles(array $files) |
||
62 | |||
63 | /** |
||
64 | * @param string $name |
||
65 | * @param string|array $value |
||
66 | */ |
||
67 | public function addGlobalVarialbe(string $name, $value) |
||
71 | |||
72 | public function getGlobalVariables() : array |
||
76 | |||
77 | public function setSourceDirectory(string $sourceDirectory) |
||
81 | |||
82 | public function getSourceDirectory() : string |
||
86 | |||
87 | public function setOutputDirectory(string $outputDirectory) |
||
91 | |||
92 | public function getOutputDirectory() : string |
||
96 | |||
97 | public function setPostRoute(string $postRoute) |
||
101 | |||
102 | public function getPostRoute() : string |
||
106 | |||
107 | private function extractPostRoute(array $options) : array |
||
118 | } |
||
119 |