Issues (4057)

Branch: fix-integration-tests

config/bootstrap.php (3 issues)

1
<?php
2
0 ignored issues
show
Missing file doc comment
Loading history...
3
use Symfony\Component\Yaml\Yaml;
4
5
require dirname(__DIR__).'/vendor/autoload.php';
6
$parametersPath = dirname(__DIR__).'/config/openconext/parameters.yaml';
7
$parameters = Yaml::parseFile($parametersPath);
8
$parameters = $parameters['parameters'];
9
$requiredParameters = ['app_env', 'app_debug', 'app_secret'];
10
11
// Test if required parameters are set
12
if (0 !== count(array_diff($requiredParameters, array_keys($parameters)))) {
13
    throw new RuntimeException(sprintf(
0 ignored issues
show
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
14
        'Required parameters are not configured, required params are: %s, configure them in %s',
15
        implode(', ', $requiredParameters),
16
        $parametersPath
17
    ));
0 ignored issues
show
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
18
}
19
20
$_SERVER['APP_ENV'] = $parameters['app_env'];
21
$_SERVER['APP_DEBUG'] = $parameters['app_debug'];
22
$_SERVER['APP_SECRET'] = $parameters['app_secret'];
23
24
// Allow the application environment (dev/test/prod) to change via the APP_ENV environment variable.
25
if (array_key_exists('APP_ENV', $_ENV)) {
26
    $_SERVER['APP_ENV'] = $_ENV['APP_ENV'];
27
}
28
29
filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
30