3131use Symfony \Component \DependencyInjection \ContainerBuilder ;
3232use Symfony \Component \DependencyInjection \Exception \ServiceNotFoundException ;
3333use Symfony \Component \DependencyInjection \Extension \Extension ;
34- use Symfony \Component \DependencyInjection \Loader \YamlFileLoader ;
34+ use Symfony \Component \DependencyInjection \Loader \PhpFileLoader ;
3535use Symfony \Component \DependencyInjection \Reference ;
3636
3737/**
3838 * @author William Durand <william.durand1@gmail.com>.
3939 */
40- class BazingaGeocoderExtension extends Extension
40+ final class BazingaGeocoderExtension extends Extension
4141{
4242 /**
4343 * @param array<mixed, mixed> $configs
44- *
45- * @return void
4644 */
47- public function load (array $ configs , ContainerBuilder $ container )
45+ public function load (array $ configs , ContainerBuilder $ container ): void
4846 {
4947 $ processor = new Processor ();
5048 $ configuration = $ this ->getConfiguration ($ configs , $ container );
5149 $ config = $ processor ->processConfiguration ($ configuration , $ configs );
5250
53- $ loader = new YamlFileLoader ($ container , new FileLocator (__DIR__ .'/../../config ' ));
54- $ loader ->load ('services.yml ' );
51+ $ loader = new PhpFileLoader ($ container , new FileLocator (__DIR__ .'/../../config ' ));
52+ $ loader ->load ('services.php ' );
5553
5654 if (true === $ config ['profiling ' ]['enabled ' ]) {
57- $ loader ->load ('profiling.yml ' );
55+ $ loader ->load ('profiling.php ' );
5856 }
5957
6058 if ($ config ['fake_ip ' ]['enabled ' ]) {
@@ -78,10 +76,8 @@ public function load(array $configs, ContainerBuilder $container)
7876
7977 /**
8078 * @param array<mixed, mixed> $config
81- *
82- * @return void
8379 */
84- private function loadProviders (ContainerBuilder $ container , array $ config )
80+ private function loadProviders (ContainerBuilder $ container , array $ config ): void
8581 {
8682 foreach ($ config ['providers ' ] as $ providerName => $ providerConfig ) {
8783 try {
@@ -93,7 +89,7 @@ private function loadProviders(ContainerBuilder $container, array $config)
9389 // See if any option has a service reference
9490 $ providerConfig ['options ' ] = $ this ->findReferences ($ providerConfig ['options ' ]);
9591 $ factoryClass ::validate ($ providerConfig ['options ' ], $ providerName );
96- } catch (ServiceNotFoundException $ e ) {
92+ } catch (ServiceNotFoundException ) {
9793 // Assert: We are using a custom factory. If invalid config, it will be caught in FactoryValidatorPass
9894 $ providerConfig ['options ' ] = $ this ->findReferences ($ providerConfig ['options ' ]);
9995 FactoryValidatorPass::addFactoryServiceId ($ providerConfig ['factory ' ]);
0 commit comments