Issues (822)

api/features/bootstrap/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
// The check is to ensure we don't use .env in production
6
if (!isset($_SERVER['APP_ENV'])) {
7
    if (!class_exists(Dotenv::class)) {
8
        throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
9
    }
10
    (new Dotenv())->load(__DIR__.'/../../.env');
11
}
12