Issues (12)

symfony/config/bootstrap.php (1 issue)

Labels
Severity
1
<?php
2
3
use Symfony\Component\Dotenv\Dotenv;
0 ignored issues
show
The type Symfony\Component\Dotenv\Dotenv was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
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);
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