Issues (257)

config/bootstrap.php (1 issue)

Labels
Severity
1
<?php
2
3
use Symfony\Component\Dotenv\Dotenv;
4
5
require dirname(__DIR__).'/vendor/autoload.php';
6
7
if (!class_exists(Dotenv::class)) {
8
    throw new LogicException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
9
}
10
11
// Load cached env vars if the .env.local.php file exists
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'])) {
14
    (new Dotenv(false))->populate($env);
0 ignored issues
show
false of type false is incompatible with the type string expected by parameter $envKey of Symfony\Component\Dotenv\Dotenv::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

14
    (new Dotenv(/** @scrutinizer ignore-type */ false))->populate($env);
Loading history...
15
} else {
16
    // load all the .env files
17
    (new Dotenv(false))->loadEnv(dirname(__DIR__).'/.env');
18
}
19
20
$_SERVER += $_ENV;
21
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';
22
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
23
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
24