@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | public function registerBundles(): iterable |
34 | 34 | { |
35 | - $contents = require $this->getProjectDir().'/config/bundles.php'; |
|
35 | + $contents = require $this->getProjectDir() . '/config/bundles.php'; |
|
36 | 36 | foreach ($contents as $class => $envs) { |
37 | 37 | if ($envs[$this->environment] ?? $envs['all'] ?? false) { |
38 | 38 | yield new $class(); |
@@ -47,23 +47,23 @@ discard block |
||
47 | 47 | |
48 | 48 | protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void |
49 | 49 | { |
50 | - $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php')); |
|
50 | + $container->addResource(new FileResource($this->getProjectDir() . '/config/bundles.php')); |
|
51 | 51 | $container->setParameter('container.dumper.inline_class_loader', \PHP_VERSION_ID < 70400 || $this->debug); |
52 | 52 | $container->setParameter('container.dumper.inline_factories', true); |
53 | - $confDir = $this->getProjectDir().'/config'; |
|
53 | + $confDir = $this->getProjectDir() . '/config'; |
|
54 | 54 | |
55 | - $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob'); |
|
56 | - $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob'); |
|
57 | - $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob'); |
|
58 | - $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob'); |
|
55 | + $loader->load($confDir . '/{packages}/*' . self::CONFIG_EXTS, 'glob'); |
|
56 | + $loader->load($confDir . '/{packages}/' . $this->environment . '/*' . self::CONFIG_EXTS, 'glob'); |
|
57 | + $loader->load($confDir . '/{services}' . self::CONFIG_EXTS, 'glob'); |
|
58 | + $loader->load($confDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob'); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | protected function configureRoutes(RouteCollectionBuilder $routes): void |
62 | 62 | { |
63 | - $confDir = $this->getProjectDir().'/config'; |
|
63 | + $confDir = $this->getProjectDir() . '/config'; |
|
64 | 64 | |
65 | - $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob'); |
|
66 | - $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob'); |
|
67 | - $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob'); |
|
65 | + $routes->import($confDir . '/{routes}/' . $this->environment . '/*' . self::CONFIG_EXTS, '/', 'glob'); |
|
66 | + $routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS, '/', 'glob'); |
|
67 | + $routes->import($confDir . '/{routes}' . self::CONFIG_EXTS, '/', 'glob'); |
|
68 | 68 | } |
69 | 69 | } |
@@ -69,7 +69,7 @@ |
||
69 | 69 | if ($subjectNameIdFromResponse !== $secondFactor->secondFactorIdentifier) { |
70 | 70 | throw new ReceivedInvalidSubjectNameIdException( |
71 | 71 | sprintf( |
72 | - 'The nameID received from the GSSP (%s) did not match the selected second factor (%s). This '. |
|
72 | + 'The nameID received from the GSSP (%s) did not match the selected second factor (%s). This ' . |
|
73 | 73 | 'might be an indication someone is tampering with a GSSP. The authentication was started by %s', |
74 | 74 | $subjectNameIdFromResponse, |
75 | 75 | $secondFactor->secondFactorIdentifier, |
@@ -149,7 +149,7 @@ |
||
149 | 149 | } else { |
150 | 150 | // Render the regular SAML response, we do not return it yet, the SSO on 2FA handler will use it to store |
151 | 151 | // the SSO on 2FA cookie. |
152 | - $httpResponse = $responseRendering->renderResponse($responseContext, $response, $request); |
|
152 | + $httpResponse = $responseRendering->renderResponse($responseContext, $response, $request); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | if ($response->isSuccess()) { |
@@ -160,7 +160,7 @@ |
||
160 | 160 | private function addAuthenticationStatementTo(Assertion $newAssertion, Assertion $assertion): void |
161 | 161 | { |
162 | 162 | $newAssertion->setAuthnInstant($assertion->getAuthnInstant()); |
163 | - $newAssertion->setAuthnContextClassRef((string)$this->intrinsicLoa); |
|
163 | + $newAssertion->setAuthnContextClassRef((string) $this->intrinsicLoa); |
|
164 | 164 | |
165 | 165 | $authority = $assertion->getAuthenticatingAuthority(); |
166 | 166 | $newAssertion->setAuthenticatingAuthority( |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | */ |
198 | 198 | public function anInstitutionThatAllows(string $institution, string $option): void |
199 | 199 | { |
200 | - switch(true) { |
|
200 | + switch (true) { |
|
201 | 201 | case $option === 'sso_on_2fa': |
202 | 202 | $optionColumnName = 'sso_on2fa_enabled'; |
203 | 203 | break; |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | private function getCookieNames(array $responseCookieHeaders): array |
366 | 366 | { |
367 | 367 | $response = []; |
368 | - foreach($responseCookieHeaders as $cookie) { |
|
368 | + foreach ($responseCookieHeaders as $cookie) { |
|
369 | 369 | $parts = explode('=', $cookie); |
370 | 370 | $response[] = array_shift($parts); |
371 | 371 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $configuration = new Configuration(); |
43 | 43 | $config = $this->processConfiguration($configuration, $configs); |
44 | 44 | |
45 | - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
45 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
46 | 46 | $loader->load('services.yml'); |
47 | 47 | |
48 | 48 | $connectedServiceProviders = $container->getDefinition('gssp.allowed_sps'); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $hostedDefinition = $this->buildHostedEntityDefinition($provider, $configuration, $routes); |
138 | 138 | $container->setDefinition('gssp.provider.' . $provider . '.hosted_entities', $hostedDefinition); |
139 | 139 | |
140 | - $hostedSpDefinition = (new Definition()) |
|
140 | + $hostedSpDefinition = (new Definition()) |
|
141 | 141 | ->setClass(\Surfnet\SamlBundle\Entity\ServiceProvider::class) |
142 | 142 | ->setFactory([new Reference('gssp.provider.' . $provider . '.hosted_entities'), 'getServiceProvider']) |
143 | 143 | ->setPublic(false); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | */ |
191 | 191 | private function createRemoteDefinition($provider, array $configuration, ContainerBuilder $container): void |
192 | 192 | { |
193 | - $definition = new Definition(\Surfnet\SamlBundle\Entity\IdentityProvider::class, [ |
|
193 | + $definition = new Definition(\Surfnet\SamlBundle\Entity\IdentityProvider::class, [ |
|
194 | 194 | [ |
195 | 195 | 'entityId' => $configuration['entity_id'], |
196 | 196 | 'ssoUrl' => $configuration['sso_url'], |