sleep() should not be used

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

  1. }
  2. // block until the web server is ready
  3. usleep(1000);
  4. }
  5. sleep(1);

    sleep() may create timeouts without even protecting your application.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Kévin Dunglas
  6. }
  7. }
  • dunglas

    Ignored on Sun, 23 Sep 2018 18:04:45 GMT

Error silenced by the at sign (@)

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

  1. 'protocol_version' => '1.1',
  2. 'header' => ['Connection: close'],
  3. 'timeout' => 5,
  4. ]]);
  5. while (Process::STATUS_STARTED !== ($status = $process->getStatus()) || false === @file_get_contents($url, false, $context)) {

    Adding "@" before file_get_contents($url, false, $context) prevents warning and errors during this function execution from being displayed.
    If you need to do that, you should probably implement a better way to qualify and recover from errors, using Exceptions.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Kévin Dunglas
  6. if (Process::STATUS_TERMINATED === $status) {
  7. throw new \RuntimeException($process->getErrorOutput(), $process->getExitCode());
  8. }
  9. // block until the web server is ready
  • dunglas

    Ignored on Sun, 23 Sep 2018 18:04:51 GMT

Class should be unique per PHP file

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

This file contains 2 classes. Keeping only one class per file is a standard in the PHP community, since it promotes interoperability and maintainability.

Time to fix: about 4 hours
Open Issue Permalink
Last edited by Kévin Dunglas
  • PantherTestCase (defined at line 20)
  • PantherTestCase (defined at line 25)
  • dunglas

    Ignored on Tue, 21 Aug 2018 12:28:12 GMT