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);