1 | <?php |
||
22 | abstract class RoutesLoaderBuilder |
||
23 | { |
||
24 | /** |
||
25 | * Configuration array. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $configuration; |
||
30 | |||
31 | /** |
||
32 | * The container builder. |
||
33 | * |
||
34 | * @var ContainerBuilder |
||
35 | */ |
||
36 | protected $container; |
||
37 | |||
38 | /** |
||
39 | * Constructor. |
||
40 | * |
||
41 | * @param ContainerBuilder $container The container builder |
||
42 | * @param array $configuration The configuration tree |
||
43 | */ |
||
44 | public function __construct(ContainerBuilder $container, array $configuration = []) |
||
49 | |||
50 | /** |
||
51 | * Entry point of routes loader builder to |
||
52 | * inject routes inside route loader. |
||
53 | * |
||
54 | * @return ContainerBuilder |
||
55 | */ |
||
56 | public function build() |
||
76 | |||
77 | /** |
||
78 | * Gets the configuration after sanitize process. |
||
79 | * |
||
80 | * @return array |
||
81 | */ |
||
82 | public function configuration() |
||
86 | |||
87 | /** |
||
88 | * Sanitizes and validates the given configuration tree. |
||
89 | * |
||
90 | * @param array $configuration The configuration tree |
||
91 | * |
||
92 | * @return array |
||
93 | */ |
||
94 | protected function sanitize(array $configuration) |
||
113 | |||
114 | /** |
||
115 | * Gets the route loader's default upload dir. |
||
116 | * |
||
117 | * @param string $file The file name |
||
118 | * |
||
119 | * @return string |
||
120 | */ |
||
121 | protected function defaultUploadDir($file) |
||
124 | |||
125 | /** |
||
126 | * Gets the service definition name. |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | abstract protected function definitionName(); |
||
131 | |||
132 | /** |
||
133 | * Gets the route loader's default route name. |
||
134 | * |
||
135 | * @param string $file The file name |
||
136 | * |
||
137 | * @return string |
||
138 | */ |
||
139 | protected function defaultRouteName($file) |
||
142 | |||
143 | /** |
||
144 | * Gets the route loader's default route path. |
||
145 | * |
||
146 | * @param string $file The file name |
||
147 | * |
||
148 | * @return string |
||
149 | */ |
||
150 | protected function defaultRoutePath($file) |
||
153 | |||
154 | /** |
||
155 | * Gets the service definition API name. |
||
156 | * |
||
157 | * @return string |
||
158 | */ |
||
159 | protected function definitionApiName() |
||
162 | |||
163 | /** |
||
164 | * Gets the route loader's default API route name. |
||
165 | * |
||
166 | * @param string $file The file name |
||
167 | * |
||
168 | * @return string |
||
169 | */ |
||
170 | protected function defaultApiRouteName($file) |
||
173 | |||
174 | /** |
||
175 | * Gets the route loader's default API route path. |
||
176 | * |
||
177 | * @param string $file The file name |
||
178 | * |
||
179 | * @return string |
||
180 | */ |
||
181 | protected function defaultApiRoutePath($file) |
||
184 | } |
||
185 |