1111use Auth0 \Symfony \Controllers \AuthenticationController ;
1212use Auth0 \Symfony \Security \{Authenticator , Authorizer , UserProvider };
1313use Auth0 \Symfony \Stores \SessionStore ;
14- use LogicException ;
1514use OpenSSLAsymmetricKey ;
1615use Psr \Cache \CacheItemPoolInterface ;
1716use Psr \EventDispatcher \ListenerProviderInterface ;
1817use Psr \Http \Client \ClientInterface ;
1918use Psr \Http \Message \{RequestFactoryInterface , ResponseFactoryInterface , StreamFactoryInterface };
2019use Symfony \Component \Config \Definition \Configurator \DefinitionConfigurator ;
21- use Symfony \Component \DependencyInjection \{ContainerBuilder , Reference };
22- use Symfony \Component \DependencyInjection \Exception \InvalidArgumentException ;
2320use Symfony \Component \DependencyInjection \Loader \Configurator \ContainerConfigurator ;
21+ use Symfony \Component \DependencyInjection \{ContainerBuilder , Reference };
2422use Symfony \Component \HttpKernel \Bundle \AbstractBundle ;
2523
2624final class Auth0Bundle extends AbstractBundle implements BundleInterface
@@ -31,45 +29,44 @@ public function configure(DefinitionConfigurator $definition): void
3129 }
3230
3331 /**
34- * @param array<mixed> $config The configuration array.
32+ * @param array<mixed> $config The configuration array.
3533 * @param ContainerConfigurator $container The container configurator.
36- * @param ContainerBuilder $builder The container builder.
34+ * @param ContainerBuilder $builder The container builder.
3735 */
3836 public function loadExtension (array $ config , ContainerConfigurator $ container , ContainerBuilder $ builder ): void
3937 {
4038 $ sdkConfig = $ config ['sdk ' ] ?? [];
4139
4240 /**
43- * @var array{strategy: string, domain: ?string, custom_domain: ?string, client_id: ?string, redirect_uri: ?string, client_secret: ?string, audiences: null|array<string>, organizations: array<string>|null, use_pkce: bool, scopes: array<string>|null, response_mode: string, response_type: string, token_algorithm: ?string, token_jwks_uri: ?string, token_max_age: ?int, token_leeway: ?int, token_cache: ?CacheItemPoolInterface, token_cache_ttl: int, http_client: null|string|ClientInterface, http_max_retries: int, http_request_factory: null|string|RequestFactoryInterface, http_response_factory: null|string|ResponseFactoryInterface, http_stream_factory: null|string|StreamFactoryInterface, http_telemetry: bool, session_storage: ?StoreInterface, session_storage_prefix: ?string, cookie_secret: ?string, cookie_domain: ?string, cookie_expires: int, cookie_path: string, cookie_secure: bool, cookie_same_site: ?string, persist_user: bool, persist_id_token: bool, persist_access_token: bool, persist_refresh_token: bool, transient_storage: ?StoreInterface, transient_storage_prefix: ?string, query_user_info: bool, management_token: ?string, management_token_cache: ?CacheItemPoolInterface, event_listener_provider: null|string|ListenerProviderInterface, client_assertion_signing_key: null|OpenSSLAsymmetricKey|string, client_assertion_signing_algorithm: string, pushed_authorization_request: bool, backchannel_logout_cache: ?CacheItemPoolInterface, backchannel_logout_expires: int} $sdkConfig
41+ * @var array{strategy: string, domain: ?string, custom_domain: ?string, client_id: ?string, redirect_uri: ?string, client_secret: ?string, audiences: null|array<string>, organizations: null|array<string>, use_pkce: bool, scopes: null|array<string>, response_mode: string, response_type: string, token_algorithm: ?string, token_jwks_uri: ?string, token_max_age: ?int, token_leeway: ?int, token_cache: ?CacheItemPoolInterface, token_cache_ttl: int, http_client: null|ClientInterface|string, http_max_retries: int, http_request_factory: null|RequestFactoryInterface|string, http_response_factory: null|ResponseFactoryInterface|string, http_stream_factory: null|StreamFactoryInterface|string, http_telemetry: bool, session_storage: ?StoreInterface, session_storage_prefix: ?string, cookie_secret: ?string, cookie_domain: ?string, cookie_expires: int, cookie_path: string, cookie_secure: bool, cookie_same_site: ?string, persist_user: bool, persist_id_token: bool, persist_access_token: bool, persist_refresh_token: bool, transient_storage: ?StoreInterface, transient_storage_prefix: ?string, query_user_info: bool, management_token: ?string, management_token_cache: ?CacheItemPoolInterface, event_listener_provider: null|ListenerProviderInterface|string, client_assertion_signing_key: null|OpenSSLAsymmetricKey|string, client_assertion_signing_algorithm: string, pushed_authorization_request: bool, backchannel_logout_cache: ?CacheItemPoolInterface, backchannel_logout_expires: int} $sdkConfig
4442 */
45-
4643 $ tokenCache = $ sdkConfig ['token_cache ' ] ?? 'cache.app ' ;
4744
48- if (! $ tokenCache instanceOf CacheItemPoolInterface) {
45+ if (! $ tokenCache instanceof CacheItemPoolInterface) {
4946 $ tokenCache = new Reference ($ tokenCache );
5047 }
5148
5249 $ managementTokenCache = $ sdkConfig ['management_token_cache ' ] ?? 'cache.app ' ;
5350
54- if (! $ managementTokenCache instanceOf CacheItemPoolInterface) {
51+ if (! $ managementTokenCache instanceof CacheItemPoolInterface) {
5552 $ managementTokenCache = new Reference ($ managementTokenCache );
5653 }
5754
5855 $ backchannelLogoutCache = $ sdkConfig ['backchannel_logout_cache ' ] ?? 'cache.app ' ;
5956
60- if (! $ backchannelLogoutCache instanceOf CacheItemPoolInterface) {
57+ if (! $ backchannelLogoutCache instanceof CacheItemPoolInterface) {
6158 $ backchannelLogoutCache = new Reference ($ backchannelLogoutCache );
6259 }
6360
6461 $ transientStorage = $ sdkConfig ['transient_storage ' ] ?? 'auth0.store_transient ' ;
6562
66- if (! $ transientStorage instanceOf StoreInterface) {
63+ if (! $ transientStorage instanceof StoreInterface) {
6764 $ transientStorage = new Reference ($ transientStorage );
6865 }
6966
7067 $ sessionStorage = $ sdkConfig ['session_storage ' ] ?? 'auth0.store_session ' ;
7168
72- if (! $ sessionStorage instanceOf StoreInterface) {
69+ if (! $ sessionStorage instanceof StoreInterface) {
7370 $ sessionStorage = new Reference ($ sessionStorage );
7471 }
7572
@@ -78,31 +75,31 @@ public function loadExtension(array $config, ContainerConfigurator $container, C
7875
7976 $ eventListenerProvider = $ sdkConfig ['event_listener_provider ' ] ?? null ;
8077
81- if (! $ eventListenerProvider instanceOf ListenerProviderInterface && $ eventListenerProvider !== '' && $ eventListenerProvider !== null ) {
78+ if (! $ eventListenerProvider instanceof ListenerProviderInterface && '' !== $ eventListenerProvider && null !== $ eventListenerProvider ) {
8279 $ eventListenerProvider = new Reference ($ eventListenerProvider );
8380 }
8481
8582 $ httpClient = $ sdkConfig ['http_client ' ] ?? null ;
8683
87- if (! $ httpClient instanceOf ClientInterface && $ httpClient !== '' && $ httpClient !== null ) {
84+ if (! $ httpClient instanceof ClientInterface && '' !== $ httpClient && null !== $ httpClient ) {
8885 $ httpClient = new Reference ($ httpClient );
8986 }
9087
9188 $ httpRequestFactory = $ sdkConfig ['http_request_factory ' ] ?? null ;
9289
93- if (! $ httpRequestFactory instanceOf RequestFactoryInterface && $ httpRequestFactory !== '' && $ httpRequestFactory !== null ) {
90+ if (! $ httpRequestFactory instanceof RequestFactoryInterface && '' !== $ httpRequestFactory && null !== $ httpRequestFactory ) {
9491 $ httpRequestFactory = new Reference ($ httpRequestFactory );
9592 }
9693
9794 $ httpResponseFactory = $ sdkConfig ['http_response_factory ' ] ?? null ;
9895
99- if (! $ httpResponseFactory instanceOf ResponseFactoryInterface && $ httpResponseFactory !== '' && $ httpResponseFactory !== null ) {
96+ if (! $ httpResponseFactory instanceof ResponseFactoryInterface && '' !== $ httpResponseFactory && null !== $ httpResponseFactory ) {
10097 $ httpResponseFactory = new Reference ($ httpResponseFactory );
10198 }
10299
103100 $ httpStreamFactory = $ sdkConfig ['http_stream_factory ' ] ?? null ;
104101
105- if (! $ httpStreamFactory instanceOf StreamFactoryInterface && $ httpStreamFactory !== '' && $ httpStreamFactory !== null ) {
102+ if (! $ httpStreamFactory instanceof StreamFactoryInterface && '' !== $ httpStreamFactory && null !== $ httpStreamFactory ) {
106103 $ httpStreamFactory = new Reference ($ httpStreamFactory );
107104 }
108105
0 commit comments