src/Phug/TwigExtension.php
Avoid using static access to class 'Phug\PugToTwig' in method '__construct'. Open
Open
PugToTwig::enableTwigFormatter($container);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Checking instanceof against undeclared class \Phug\Renderer
Open
Open
if ($container instanceof Renderer) {
- Exclude checks
Parameter $container
has undeclared type \Phug\Util\ModuleContainerInterface
Open
Open
public function __construct(ModuleContainerInterface $container)
- Exclude checks
Reference to undeclared class \Phug\AbstractCompilerModule
Open
Open
parent::__construct($container);
- Exclude checks
Argument 1 (compiler)
is \Phug\Util\ModuleContainerInterface
but \Phug\PugToTwig::enableTwigFormatter()
takes \Phug\CompilerInterface
defined at /code/src/Phug/PugToTwig.php:42
Open
Open
PugToTwig::enableTwigFormatter($container);
- Exclude checks
Class extends undeclared class \Phug\AbstractCompilerModule
Open
Open
class TwigExtension extends AbstractCompilerModule
- Exclude checks