src/Pug/Pug.php
Missing class import via use statement (line '122', column '19'). Open
Open
throw new \ErrorException(
- Read upRead up
- Exclude checks
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
Open
Phug::setRendererClassName(static::class);
- 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\Pug::getOption
Open
Open
'cacheFolderExists' => !$this->getDefaultOption('cache_dir') || is_dir($this->getOption('cache_dir')),
- Exclude checks
Reference to constant class
from undeclared class \Phug\Renderer\Adapter\StreamAdapter
Open
Open
'->stream() is no longer available, please use ' . StreamAdapter::class . ' instead',
- Exclude checks
Call to method setRendererClassName
from undeclared class \Phug\Phug
Open
Open
Phug::setRendererClassName(static::class);
- Exclude checks
Static call to undeclared method \Pug\Engine\Renderer::__construct
Open
Open
parent::__construct($options);
- Exclude checks
Call to undeclared method \Pug\Pug::setOption
Open
Open
return $this->setOption($name, $value);
- Exclude checks
Call to undeclared method \Pug\Pug::getOption
Open
Open
'cacheFolderIsWritable' => !$this->getDefaultOption('cache_dir') || is_writable($this->getOption('cache_dir')),
- Exclude checks
Call to undeclared method \Pug\Pug::setOptions
Open
Open
return $this->setOptions($options);
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
Open
'cacheFolderIsWritable' => !$this->getDefaultOption('cache_dir') || is_writable($this->getOption('cache_dir')),
- Exclude checks
Line exceeds 120 characters; contains 150 characters Open
Open
throw new InvalidArgumentException($name . ' is not in the requirements list (' . implode(', ', array_keys($requirements)) . ')', 19);
- Exclude checks