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) |
||
95 | |||
96 | /** |
||
97 | * Gets the route loader's default upload dir. |
||
98 | * |
||
99 | * @param string $file The file name |
||
100 | * |
||
101 | * @return string |
||
102 | */ |
||
103 | protected function defaultUploadDir($file) |
||
106 | |||
107 | /** |
||
108 | * Gets the service definition name. |
||
109 | * |
||
110 | * @return string |
||
111 | */ |
||
112 | abstract protected function definitionName(); |
||
113 | } |
||
114 |