src/Pug/Engine/Keywords.php
Avoid using static access to class '\Phug\Phug' in method 'addExtension'. Open
Open
$options = Phug::getExtensionsOptions([$extension]);
- 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
Call to undeclared method \Pug\Engine\Keywords::setOption
Open
Open
$this->setOption(['keywords', $keyword], $action);
- Exclude checks
Call to undeclared method \Pug\Engine\Keywords::unsetOption
Open
Open
$this->unsetOption(['keywords', $keyword]);
- Exclude checks
Call to undeclared method \Pug\Engine\Keywords::getCompiler
Open
Open
foreach ([$this, $this->getCompiler()] as $instance) {
- Exclude checks
Call to undeclared method \Pug\Engine\Keywords::getOption
Open
Open
return $this->hasOption($name) ? $this->getOption($name) : $defaultValue;
- Exclude checks
Call to undeclared method \Pug\Engine\Keywords::hasOption
Open
Open
return $this->hasOption($name) ? $this->getOption($name) : $defaultValue;
- Exclude checks
Call to method getExtensionsOptions
from undeclared class \Phug\Phug
Open
Open
$options = Phug::getExtensionsOptions([$extension]);
- Exclude checks
Call to undeclared method \Pug\Engine\Keywords::setOption
Open
Open
$this->setOption('keywords', []);
- Exclude checks
Parameter $extension
has undeclared type \Phug\ExtensionInterface
Open
Open
public function addExtension(ExtensionInterface $extension)
- Exclude checks
Call to undeclared method \Pug\Engine\Keywords::setOptionsRecursive
Open
Open
$instance->setOptionsRecursive($options);
- Exclude checks
Call to undeclared method \Pug\Engine\Keywords::initCompiler
Open
Open
$this->initCompiler();
- Exclude checks