@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | use Symfony\Component\Dotenv\Dotenv; |
| 4 | 4 | |
| 5 | -require dirname(__DIR__).'/vendor/autoload.php'; |
|
| 5 | +require dirname(__DIR__) . '/vendor/autoload.php'; |
|
| 6 | 6 | |
| 7 | 7 | if (!class_exists(Dotenv::class)) { |
| 8 | 8 | throw new LogicException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); |
@@ -10,11 +10,11 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | // Load cached env vars if the .env.local.php file exists |
| 12 | 12 | // Run "composer dump-env prod" to create it (requires symfony/flex >=1.2) |
| 13 | -if (is_array($env = @include dirname(__DIR__).'/.env.local.php') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) { |
|
| 13 | +if (is_array($env = @include dirname(__DIR__) . '/.env.local.php') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) { |
|
| 14 | 14 | (new Dotenv(false))->populate($env); |
| 15 | 15 | } else { |
| 16 | 16 | // load all the .env files |
| 17 | - (new Dotenv(false))->loadEnv(dirname(__DIR__).'/.env'); |
|
| 17 | + (new Dotenv(false))->loadEnv(dirname(__DIR__) . '/.env'); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | $_SERVER += $_ENV; |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | use Symfony\Component\ErrorHandler\Debug; |
| 5 | 5 | use Symfony\Component\HttpFoundation\Request; |
| 6 | 6 | |
| 7 | -require dirname(__DIR__).'/config/bootstrap.php'; |
|
| 7 | +require dirname(__DIR__) . '/config/bootstrap.php'; |
|
| 8 | 8 | |
| 9 | 9 | if ($_SERVER['APP_DEBUG']) { |
| 10 | 10 | umask(0000); |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | public function anInstitutionThatAllows(string $institution, string $option) |
| 193 | 193 | { |
| 194 | - switch(true) { |
|
| 194 | + switch (true) { |
|
| 195 | 195 | case $option === 'sso_on_2fa': |
| 196 | 196 | $optionColumnName = 'sso_on2fa_enabled'; |
| 197 | 197 | break; |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | private function getCookieNames(array $responseCookieHeaders): array |
| 311 | 311 | { |
| 312 | 312 | $response = []; |
| 313 | - foreach($responseCookieHeaders as $cookie) { |
|
| 313 | + foreach ($responseCookieHeaders as $cookie) { |
|
| 314 | 314 | $parts = explode('=', $cookie); |
| 315 | 315 | $response[] = array_shift($parts); |
| 316 | 316 | } |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | $request = Saml2AuthnRequest::createNew($authnRequest); |
| 201 | 201 | $query = $request->buildRequestQuery(); |
| 202 | 202 | |
| 203 | - $this->getSession()->visit($request->getDestination().'?'.$query); |
|
| 203 | + $this->getSession()->visit($request->getDestination() . '?' . $query); |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | /** |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | ); |
| 257 | 257 | $request = Saml2AuthnRequest::createNew($authnRequest); |
| 258 | 258 | $query = $request->buildRequestQuery(); |
| 259 | - $this->getSession()->visit($authnRequest->getDestination().'?'.$query); |
|
| 259 | + $this->getSession()->visit($authnRequest->getDestination() . '?' . $query); |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | /** |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | |
| 298 | 298 | $request = Saml2AuthnRequest::createNew($authnRequest); |
| 299 | 299 | $query = $request->buildRequestQuery(); |
| 300 | - $this->getSession()->visit($request->getDestination().'?'.$query); |
|
| 300 | + $this->getSession()->visit($request->getDestination() . '?' . $query); |
|
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | /** |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | use App\Kernel; |
| 4 | 4 | use Symfony\Component\HttpFoundation\Request; |
| 5 | 5 | |
| 6 | -require dirname(__DIR__).'/config/bootstrap.php'; |
|
| 6 | +require dirname(__DIR__) . '/config/bootstrap.php'; |
|
| 7 | 7 | |
| 8 | 8 | $kernel = new Kernel('test', false); |
| 9 | 9 | $request = Request::createFromGlobals(); |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | $this->hostedIdentityProvider = $hostedIdentityProvider; |
| 67 | 67 | $this->proxyStateHandler = $proxyStateHandler; |
| 68 | 68 | $this->assertionSigningService = $assertionSigningService; |
| 69 | - $this->currentTime = is_null($now) ? new DateTime('now', new DateTimeZone('UTC')): $now; |
|
| 69 | + $this->currentTime = is_null($now) ? new DateTime('now', new DateTimeZone('UTC')) : $now; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | ->scalarNode('http_basic_realm') |
| 34 | 34 | ->defaultValue('Secure Gateway API') |
| 35 | 35 | ->validate() |
| 36 | - ->ifTrue(function ($realm) { |
|
| 36 | + ->ifTrue(function($realm) { |
|
| 37 | 37 | return !is_string($realm) || empty($realm); |
| 38 | 38 | }) |
| 39 | 39 | ->thenInvalid("Invalid HTTP Basic realm '%s'. Must be string and non-empty.") |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | return new JsonResponse(['status' => 'OK']); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - $errors = array_map(function ($error) { |
|
| 50 | + $errors = array_map(function($error) { |
|
| 51 | 51 | return sprintf('%s (#%d)', $error['description'], $error['code']); |
| 52 | 52 | }, $result->getRawErrors()); |
| 53 | 53 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $configuration = new Configuration(); |
| 42 | 42 | $config = $this->processConfiguration($configuration, $configs); |
| 43 | 43 | |
| 44 | - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
| 44 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
| 45 | 45 | $loader->load('services.yml'); |
| 46 | 46 | |
| 47 | 47 | $connectedServiceProviders = $container->getDefinition('gssp.allowed_sps'); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $hostedDefinition = $this->buildHostedEntityDefinition($provider, $configuration, $routes); |
| 137 | 137 | $container->setDefinition('gssp.provider.' . $provider . '.hosted_entities', $hostedDefinition); |
| 138 | 138 | |
| 139 | - $hostedSpDefinition = (new Definition()) |
|
| 139 | + $hostedSpDefinition = (new Definition()) |
|
| 140 | 140 | ->setClass('Surfnet\SamlBundle\Entity\ServiceProvider') |
| 141 | 141 | ->setFactory([new Reference('gssp.provider.' . $provider . '.hosted_entities'), 'getServiceProvider']) |
| 142 | 142 | ->setPublic(false); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | private function createRemoteDefinition($provider, array $configuration, ContainerBuilder $container) |
| 191 | 191 | { |
| 192 | - $definition = new Definition('Surfnet\SamlBundle\Entity\IdentityProvider', [ |
|
| 192 | + $definition = new Definition('Surfnet\SamlBundle\Entity\IdentityProvider', [ |
|
| 193 | 193 | [ |
| 194 | 194 | 'entityId' => $configuration['entity_id'], |
| 195 | 195 | 'ssoUrl' => $configuration['sso_url'], |