VSVverkeerskunde/gvq-api

View on GitHub
public/index.php

Summary

Maintainability
A
0 mins
Test Coverage

Define and throw a dedicated exception instead of using a generic one.
Open

        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.');
Severity: Major
Found in public/index.php by sonar-php

If you throw a general exception type, such as ErrorException, RuntimeException, or Exception in a library or framework, it forces consumers to catch all exceptions, including unknown exceptions that they do not know how to handle.

Instead, either throw a subtype that already exists in the Standard PHP Library, or create your own type that derives from Exception.

Noncompliant Code Example

throw new Exception();  // Noncompliant

Compliant Solution

throw new InvalidArgumentException();
// or
throw new UnexpectedValueException();

See

Line exceeds 120 characters; contains 228 characters
Open

        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.');
Severity: Minor
Found in public/index.php by phpcodesniffer

Multi-line function call not indented correctly; expected 4 spaces but found 2
Open

  [
Severity: Minor
Found in public/index.php by phpcodesniffer

Multi-line function call not indented correctly; expected 4 spaces but found 2
Open

  Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST
Severity: Minor
Found in public/index.php by phpcodesniffer

Multi-line function call not indented correctly; expected 4 spaces but found 2
Open

  ],
Severity: Minor
Found in public/index.php by phpcodesniffer

There are no issues that match your filters.

Category
Status