1414use Symfony \Component \DependencyInjection \ContainerBuilder ;
1515use Symfony \Component \DependencyInjection \Exception \LogicException ;
1616use Symfony \Component \DependencyInjection \Extension \Extension ;
17- use Symfony \Component \DependencyInjection \Loader \XmlFileLoader ;
17+ use Symfony \Component \DependencyInjection \Loader \PhpFileLoader ;
1818use Symfony \Component \DependencyInjection \Reference ;
1919use Symfony \Component \HttpKernel \Kernel ;
2020
@@ -33,14 +33,14 @@ public function load(array $configs, ContainerBuilder $container): void
3333 $ configuration = new Configuration ();
3434 $ config = $ this ->processConfiguration ($ configuration , $ configs );
3535
36- $ loader = new XmlFileLoader ($ container , new FileLocator (__DIR__ . '/../Resources/config ' ));
36+ $ loader = new PhpFileLoader ($ container , new FileLocator (__DIR__ . '/../Resources/config ' ));
3737
38- $ loader ->load ('jwt_manager.xml ' );
39- $ loader ->load ('key_loader.xml ' );
40- $ loader ->load ('lcobucci.xml ' );
41- $ loader ->load ('response_interceptor.xml ' );
42- $ loader ->load ('token_authenticator.xml ' );
43- $ loader ->load ('token_extractor.xml ' );
38+ $ loader ->load ('jwt_manager.php ' );
39+ $ loader ->load ('key_loader.php ' );
40+ $ loader ->load ('lcobucci.php ' );
41+ $ loader ->load ('response_interceptor.php ' );
42+ $ loader ->load ('token_authenticator.php ' );
43+ $ loader ->load ('token_extractor.php ' );
4444
4545 if (empty ($ config ['public_key ' ]) && empty ($ config ['secret_key ' ])) {
4646 $ e = new InvalidConfigurationException ('You must either configure a "public_key" or a "secret_key". ' );
@@ -89,7 +89,7 @@ public function load(array $configs, ContainerBuilder $container): void
8989 }
9090
9191 if ($ config ['set_cookies ' ]) {
92- $ loader ->load ('cookie.xml ' );
92+ $ loader ->load ('cookie.php ' );
9393
9494 $ cookieProviders = [];
9595 foreach ($ config ['set_cookies ' ] as $ name => $ attributes ) {
@@ -117,7 +117,7 @@ public function load(array $configs, ContainerBuilder $container): void
117117 }
118118
119119 if (class_exists (Application::class)) {
120- $ loader ->load ('console.xml ' );
120+ $ loader ->load ('console.php ' );
121121
122122 $ container
123123 ->getDefinition ('lexik_jwt_authentication.generate_keypair_command ' )
@@ -135,7 +135,7 @@ public function load(array $configs, ContainerBuilder $container): void
135135 throw new LogicException ('API Platform cannot be detected. Try running "composer require api-platform/core". ' );
136136 }
137137
138- $ loader ->load ('api_platform.xml ' );
138+ $ loader ->load ('api_platform.php ' );
139139
140140 $ container
141141 ->getDefinition ('lexik_jwt_authentication.api_platform.openapi.factory ' )
@@ -147,7 +147,7 @@ public function load(array $configs, ContainerBuilder $container): void
147147 $ this ->processWithWebTokenConfig ($ config , $ container , $ loader );
148148
149149 if ($ this ->isConfigEnabled ($ container , $ config ['blocklist_token ' ])) {
150- $ loader ->load ('blocklist_token.xml ' );
150+ $ loader ->load ('blocklist_token.php ' );
151151 $ blockListTokenConfig = $ config ['blocklist_token ' ];
152152 $ container ->setAlias ('lexik_jwt_authentication.blocklist_token.cache ' , $ blockListTokenConfig ['cache ' ]);
153153 } else {
@@ -205,9 +205,9 @@ private function processWithWebTokenConfig(array $config, ContainerBuilder $cont
205205 if ($ config ['access_token_issuance ' ]['enabled ' ] === false && $ config ['access_token_verification ' ]['enabled ' ] === false ) {
206206 return ;
207207 }
208- $ loader ->load ('web_token.xml ' );
208+ $ loader ->load ('web_token.php ' );
209209 if ($ config ['access_token_issuance ' ]['enabled ' ] === true ) {
210- $ loader ->load ('web_token_issuance.xml ' );
210+ $ loader ->load ('web_token_issuance.php ' );
211211 $ accessTokenBuilder = 'lexik_jwt_authentication.access_token_builder ' ;
212212 $ accessTokenBuilderDefinition = $ container ->getDefinition ($ accessTokenBuilder );
213213 $ accessTokenBuilderDefinition
@@ -223,7 +223,7 @@ private function processWithWebTokenConfig(array $config, ContainerBuilder $cont
223223 }
224224 }
225225 if ($ config ['access_token_verification ' ]['enabled ' ] === true ) {
226- $ loader ->load ('web_token_verification.xml ' );
226+ $ loader ->load ('web_token_verification.php ' );
227227 $ accessTokenLoader = 'lexik_jwt_authentication.access_token_loader ' ;
228228 $ accessTokenLoaderDefinition = $ container ->getDefinition ($ accessTokenLoader );
229229 $ accessTokenLoaderDefinition
@@ -241,6 +241,14 @@ private function processWithWebTokenConfig(array $config, ContainerBuilder $cont
241241 ->replaceArgument (11 , $ config ['access_token_verification ' ]['encryption ' ]['allowed_content_encryption_algorithms ' ])
242242 ->replaceArgument (12 , $ config ['access_token_verification ' ]['encryption ' ]['keyset ' ])
243243 ;
244+ } else {
245+ $ accessTokenLoaderDefinition
246+ ->replaceArgument (8 , null )
247+ ->replaceArgument (9 , null )
248+ ->replaceArgument (10 , null )
249+ ->replaceArgument (11 , null )
250+ ->replaceArgument (12 , null )
251+ ;
244252 }
245253 }
246254 }
0 commit comments