src/Pug/Engine/Keywords.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Avoid using static access to class '\Phug\Phug' in method 'addExtension'.
Open

            $options = Phug::getExtensionsOptions([$extension]);
Severity: Minor
Found in src/Pug/Engine/Keywords.php by phpmd

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

        $this->setOption(['keywords', $keyword], $action);
Severity: Critical
Found in src/Pug/Engine/Keywords.php by phan

Call to undeclared method \Pug\Engine\Keywords::unsetOption
Open

            $this->unsetOption(['keywords', $keyword]);
Severity: Critical
Found in src/Pug/Engine/Keywords.php by phan

Call to undeclared method \Pug\Engine\Keywords::getCompiler
Open

            foreach ([$this, $this->getCompiler()] as $instance) {
Severity: Critical
Found in src/Pug/Engine/Keywords.php by phan

Call to undeclared method \Pug\Engine\Keywords::getOption
Open

        return $this->hasOption($name) ? $this->getOption($name) : $defaultValue;
Severity: Critical
Found in src/Pug/Engine/Keywords.php by phan

Call to undeclared method \Pug\Engine\Keywords::hasOption
Open

        return $this->hasOption($name) ? $this->getOption($name) : $defaultValue;
Severity: Critical
Found in src/Pug/Engine/Keywords.php by phan

Call to method getExtensionsOptions from undeclared class \Phug\Phug
Open

            $options = Phug::getExtensionsOptions([$extension]);
Severity: Critical
Found in src/Pug/Engine/Keywords.php by phan

Call to undeclared method \Pug\Engine\Keywords::setOption
Open

            $this->setOption('keywords', []);
Severity: Critical
Found in src/Pug/Engine/Keywords.php by phan

Parameter $extension has undeclared type \Phug\ExtensionInterface
Open

    public function addExtension(ExtensionInterface $extension)
Severity: Minor
Found in src/Pug/Engine/Keywords.php by phan

Call to undeclared method \Pug\Engine\Keywords::setOptionsRecursive
Open

                $instance->setOptionsRecursive($options);
Severity: Critical
Found in src/Pug/Engine/Keywords.php by phan

Call to undeclared method \Pug\Engine\Keywords::initCompiler
Open

            $this->initCompiler();
Severity: Critical
Found in src/Pug/Engine/Keywords.php by phan

There are no issues that match your filters.

Category
Status