Your project uses discouraged functions to kill scripts 2

More information: https://insight.symfony.com/what-we-analyse/php.use_exit_function

  1. * @param AdapterInterface $console
  2. */
  3. public function __invoke(Route $route, AdapterInterface $console)
  4. {
  5. if (empty($this->config)) {
  6. exit('Unable to proceed because config data is missing.');

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Read doc Open Issue Permalink
    Last edited by Alex
  7. }
  8. $table = new Table(['columnWidths' => [23, 21, 21, 100]]);
  9. $table->setAutoSeparate(Table::AUTO_SEPARATE_HEADER);
  10. $table->setPadding(1);
  1. LocationService::DATABASE_COUNTRY,
  2. ];
  3. }
  4. if (!array_key_exists($identifier, LocationService::DATABASES)) {
  5. exit(sprintf('Invalid database identifier: %s. Use one of the following identifiers: %s.',

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Read doc Open Issue Permalink
    Last edited by Alex
  6. $identifier,
  7. implode(', ', self::getValidIdentifiers())
  8. ));
  9. }

Your project should not contain commented code 3

More information: https://insight.symfony.com/what-we-analyse/php.commented_out_code

  1. $bytes[3] = '0';
  2. return implode('.', $bytes);
  3. }
  4. // if (filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
  5. // $bytes = explode(':', $ipAddress);

    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    Time to fix: about 30 minutes
    Read doc Open Issue Permalink
    Last edited by Alex
  6. // $bytes[count($bytes) - 1] = '0000';
  7. // return implode(':', $bytes);
  8. // }
  9. throw new Exception('Invalid IP address: ' . $ipAddress);
  1. return implode('.', $bytes);
  2. }
  3. // if (filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
  4. // $bytes = explode(':', $ipAddress);
  5. // $bytes[count($bytes) - 1] = '0000';

    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    Time to fix: about 30 minutes
    Read doc Open Issue Permalink
    Last edited by Alex
  6. // return implode(':', $bytes);
  7. // }
  8. throw new Exception('Invalid IP address: ' . $ipAddress);
  9. }
  1. }
  2. // if (filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
  3. // $bytes = explode(':', $ipAddress);
  4. // $bytes[count($bytes) - 1] = '0000';
  5. // return implode(':', $bytes);

    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    Time to fix: about 30 minutes
    Read doc Open Issue Permalink
    Last edited by Alex
  6. // }
  7. throw new Exception('Invalid IP address: ' . $ipAddress);
  8. }
  9. }