2525 * @author David Buchmann
2626 * @author Wouter de Jong <wouter@wouterj.nl>
2727 */
28- class CmfRoutingExtension extends Extension
28+ final class CmfRoutingExtension extends Extension
2929{
3030 /**
3131 * {@inheritdoc}
3232 */
33- public function load (array $ configs , ContainerBuilder $ container )
33+ public function load (array $ configs , ContainerBuilder $ container ): void
3434 {
3535 $ config = $ this ->processConfiguration (new Configuration (), $ configs );
3636 $ loader = new XmlFileLoader ($ container , new FileLocator (__DIR__ .'/../Resources/config ' ));
@@ -45,7 +45,7 @@ public function load(array $configs, ContainerBuilder $container)
4545 $ loader ->load ('validators.xml ' );
4646 }
4747
48- private function setupChainRouter (array $ config , ContainerBuilder $ container , LoaderInterface $ loader )
48+ private function setupChainRouter (array $ config , ContainerBuilder $ container , LoaderInterface $ loader ): void
4949 {
5050 $ loader ->load ('routing-chain.xml ' );
5151
@@ -58,7 +58,7 @@ private function setupChainRouter(array $config, ContainerBuilder $container, Lo
5858 }
5959 }
6060
61- private function setupFormTypes (array $ config , ContainerBuilder $ container , LoaderInterface $ loader )
61+ private function setupFormTypes (array $ config , ContainerBuilder $ container , LoaderInterface $ loader ): void
6262 {
6363 $ loader ->load ('form-type.xml ' );
6464
@@ -73,12 +73,8 @@ private function setupFormTypes(array $config, ContainerBuilder $container, Load
7373
7474 /**
7575 * Set up the DynamicRouter - only to be called if enabled is set to true.
76- *
77- * @param array $config the compiled configuration for the dynamic router
78- * @param ContainerBuilder $container the container builder
79- * @param LoaderInterface $loader the configuration loader
8076 */
81- private function setupDynamicRouter (array $ config , ContainerBuilder $ container , LoaderInterface $ loader )
77+ private function setupDynamicRouter (array $ config , ContainerBuilder $ container , LoaderInterface $ loader ): void
8278 {
8379 $ loader ->load ('routing-dynamic.xml ' );
8480
@@ -210,7 +206,7 @@ private function setupDynamicRouter(array $config, ContainerBuilder $container,
210206 $ dynamic ->replaceArgument (2 , new Reference ($ config ['url_generator ' ]));
211207 }
212208
213- private function loadPhpcrProvider (array $ config , LoaderInterface $ loader , ContainerBuilder $ container , array $ locales , $ matchImplicitLocale )
209+ private function loadPhpcrProvider (array $ config , LoaderInterface $ loader , ContainerBuilder $ container , array $ locales , $ matchImplicitLocale ): void
214210 {
215211 $ loader ->load ('provider-phpcr.xml ' );
216212
@@ -232,7 +228,7 @@ private function loadPhpcrProvider(array $config, LoaderInterface $loader, Conta
232228 }
233229 }
234230
235- private function loadInitializer (LoaderInterface $ loader , ContainerBuilder $ container )
231+ private function loadInitializer (LoaderInterface $ loader , ContainerBuilder $ container ): void
236232 {
237233 $ initializedBasepaths = $ container ->getParameter ($ this ->getAlias ().'.dynamic.persistence.phpcr.route_basepaths ' );
238234
@@ -244,7 +240,7 @@ private function loadInitializer(LoaderInterface $loader, ContainerBuilder $cont
244240 $ loader ->load ('initializer-phpcr.xml ' );
245241 }
246242
247- private function loadOrmProvider (array $ config , LoaderInterface $ loader , ContainerBuilder $ container , $ matchImplicitLocale )
243+ private function loadOrmProvider (array $ config , LoaderInterface $ loader , ContainerBuilder $ container , $ matchImplicitLocale ): void
248244 {
249245 $ loader ->load ('provider-orm.xml ' );
250246
@@ -264,28 +260,21 @@ private function loadOrmProvider(array $config, LoaderInterface $loader, Contain
264260 }
265261
266262 /**
267- * @param ContainerBuilder $container The container builder
268- * @param array $config The config array
269- * @param array $settingToParameter An array with setting to parameter mappings (key = setting, value = parameter name without alias prefix)
263+ * @param array<string, string> $settingToParameter An array with setting to parameter mappings (key = setting, value = parameter name without alias prefix)
270264 */
271- private function configureParameters (ContainerBuilder $ container , array $ config , array $ settingToParameter )
265+ private function configureParameters (ContainerBuilder $ container , array $ config , array $ settingToParameter ): void
272266 {
273267 foreach ($ settingToParameter as $ setting => $ parameter ) {
274268 $ container ->setParameter ('cmf_routing. ' .$ parameter , $ config [$ setting ]);
275269 }
276270 }
277271
278- /**
279- * Returns the base path for the XSD files.
280- *
281- * @return string The XSD base path
282- */
283- public function getXsdValidationBasePath ()
272+ public function getXsdValidationBasePath (): string
284273 {
285274 return __DIR__ .'/../Resources/config/schema ' ;
286275 }
287276
288- public function getNamespace ()
277+ public function getNamespace (): string
289278 {
290279 return 'http://cmf.symfony.com/schema/dic/routing ' ;
291280 }
0 commit comments