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() |
||
67 | |||
68 | /** |
||
69 | * Gets the configuration after sanitize process. |
||
70 | * |
||
71 | * @return array |
||
72 | */ |
||
73 | public function configuration() |
||
77 | |||
78 | /** |
||
79 | * Sanitizes and validates the given configuration tree. |
||
80 | * |
||
81 | * @param array $configuration The configuration tree |
||
82 | * |
||
83 | * @return array |
||
84 | */ |
||
85 | protected function sanitize(array $configuration) |
||
107 | |||
108 | /** |
||
109 | * Gets the route loader's default upload dir. |
||
110 | * |
||
111 | * @param string $file The file name |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | protected function defaultUploadDir($file) |
||
118 | |||
119 | /** |
||
120 | * Gets the service definition name. |
||
121 | * |
||
122 | * @return string |
||
123 | */ |
||
124 | abstract protected function definitionName(); |
||
125 | |||
126 | /** |
||
127 | * Gets the route loader's default route name. |
||
128 | * |
||
129 | * @param string $file The file name |
||
130 | * |
||
131 | * @return string |
||
132 | */ |
||
133 | protected function defaultRouteName($file) |
||
136 | |||
137 | /** |
||
138 | * Gets the route loader's default route path. |
||
139 | * |
||
140 | * @param string $file The file name |
||
141 | * |
||
142 | * @return string |
||
143 | */ |
||
144 | protected function defaultRoutePath($file) |
||
147 | |||
148 | /** |
||
149 | * Gets the service definition API name. |
||
150 | * |
||
151 | * @return string |
||
152 | */ |
||
153 | protected function definitionApiName() |
||
156 | |||
157 | /** |
||
158 | * Gets the route loader's default API route name. |
||
159 | * |
||
160 | * @param string $file The file name |
||
161 | * |
||
162 | * @return string |
||
163 | */ |
||
164 | protected function defaultApiRouteName($file) |
||
167 | |||
168 | /** |
||
169 | * Gets the route loader's default API route path. |
||
170 | * |
||
171 | * @param string $file The file name |
||
172 | * |
||
173 | * @return string |
||
174 | */ |
||
175 | protected function defaultApiRoutePath($file) |
||
178 | } |
||
179 |