kylekatarnls/jade-php

View on GitHub
src/Pug/Pug.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '122', column '19').
Open

        throw new \ErrorException(
Severity: Minor
Found in src/Pug/Pug.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

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

        Phug::setRendererClassName(static::class);
Severity: Minor
Found in src/Pug/Pug.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\Pug::getOption
Open

            'cacheFolderExists'     => !$this->getDefaultOption('cache_dir') || is_dir($this->getOption('cache_dir')),
Severity: Critical
Found in src/Pug/Pug.php by phan

Reference to constant class from undeclared class \Phug\Renderer\Adapter\StreamAdapter
Open

            '->stream() is no longer available, please use ' . StreamAdapter::class . ' instead',
Severity: Critical
Found in src/Pug/Pug.php by phan

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

        Phug::setRendererClassName(static::class);
Severity: Critical
Found in src/Pug/Pug.php by phan

Static call to undeclared method \Pug\Engine\Renderer::__construct
Open

        parent::__construct($options);
Severity: Critical
Found in src/Pug/Pug.php by phan

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

        return $this->setOption($name, $value);
Severity: Critical
Found in src/Pug/Pug.php by phan

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

            'cacheFolderIsWritable' => !$this->getDefaultOption('cache_dir') || is_writable($this->getOption('cache_dir')),
Severity: Critical
Found in src/Pug/Pug.php by phan

Call to undeclared method \Pug\Pug::setOptions
Open

        return $this->setOptions($options);
Severity: Critical
Found in src/Pug/Pug.php by phan

Line exceeds 120 characters; contains 123 characters
Open

            'cacheFolderIsWritable' => !$this->getDefaultOption('cache_dir') || is_writable($this->getOption('cache_dir')),
Severity: Minor
Found in src/Pug/Pug.php by phpcodesniffer

Line exceeds 120 characters; contains 150 characters
Open

                throw new InvalidArgumentException($name . ' is not in the requirements list (' . implode(', ', array_keys($requirements)) . ')', 19);
Severity: Minor
Found in src/Pug/Pug.php by phpcodesniffer

There are no issues that match your filters.

Category
Status