YAML files should not contain syntax error

  • Critical
  • Bugrisk

More information: https://insight.sensiolabs.com/what-we-analyse/symfony.configuration.yaml_syntax_error

in .travis.yml, line 36
  1. - php: 5.6
  2. - php: 7.0
  3. DEPENDENCIES="doctrine/annotations"
  4. - php: 7.1
  5. - php: 7.2
  6. env: COVERAGE=true TEST_COMMAND="composer test-ci"

    Unable to parse at line 36 (near "DEPENDENCIES="doctrine/annotations"").

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Nyholm
  7. # Test LTS versions
  8. - php: 7.2
  9. env: DEPENDENCIES="dunglas/symfony-lock:^2 doctrine/annotations "
  10. - php: 7.2

Absolute path constants __DIR__ and __FILE__ should not be used

  • Major
  • Bugrisk

More information: https://insight.sensiolabs.com/what-we-analyse/symfony.dependency_injection.use_dir_file_constant

  1. require $proxyFile;
  2. return $proxyClass;
  3. }
  4. $content = file_get_contents(dirname(__DIR__).'/Resources/proxy/template.php');

    __DIR__ and __FILE__ constants may conflict with the Symfony resource overriding system

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Tobias Nyholm
  5. $content = str_replace('__TPL_CLASS__', $proxyClass, $content);
  6. $content = str_replace('__TPL_EXTENDS__', $class, $content);
  7. $this->checkProxyDirectory();
  8. file_put_contents($proxyFile, $content);

Unused method, property, variable or parameter

  • Minor
  • Deadcode

More information: https://insight.sensiolabs.com/what-we-analyse/php.unused_local_variable_or_private_member

  1. use Cache\CacheBundle\DataCollector\TraceableAdapterEvent;
  2. use Psr\Cache\CacheItemInterface;
  3. class __TPL_CLASS__ extends __TPL_EXTENDS__ implements CacheProxyInterface
  4. {
  5. private $__name;

    This __name attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Tobias Nyholm
  6. private $__calls = [];
  7. public function getItem($key)
  8. {
  9. $event = $this->start(__FUNCTION__, $key);