1 | <?php |
||
2 | |||
3 | use App\Kernel; |
||
4 | use Symfony\Component\Debug\Debug; |
||
0 ignored issues
–
show
|
|||
5 | 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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
6 | use Symfony\Component\HttpFoundation\Request; |
||
0 ignored issues
–
show
The type
Symfony\Component\HttpFoundation\Request 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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
7 | |||
8 | ignore_user_abort(true); |
||
9 | |||
10 | require __DIR__.'/../vendor/autoload.php'; |
||
11 | |||
12 | // The check is to ensure we don't use .env in production |
||
13 | if (!isset($_SERVER['APP_ENV'])) { |
||
14 | if (!class_exists(Dotenv::class)) { |
||
15 | 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.'); |
||
16 | } |
||
17 | (new Dotenv())->load(__DIR__.'/../.env'); |
||
18 | } |
||
19 | |||
20 | $env = $_SERVER['APP_ENV'] ?? 'dev'; |
||
21 | $debug = $_SERVER['APP_DEBUG'] ?? ('prod' !== $env); |
||
22 | |||
23 | if ($debug) { |
||
24 | umask(0000); |
||
25 | |||
26 | Debug::enable(); |
||
27 | } |
||
28 | |||
29 | if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) { |
||
30 | Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL); |
||
31 | } |
||
32 | |||
33 | if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) { |
||
34 | Request::setTrustedHosts(explode(',', $trustedHosts)); |
||
35 | } |
||
36 | |||
37 | $kernel = new Kernel($env, $debug); |
||
38 | $request = Request::createFromGlobals(); |
||
39 | $response = $kernel->handle($request); |
||
40 | $response->send(); |
||
41 | $kernel->terminate($request, $response); |
||
42 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths