Showing 115 of 115 total issues
Avoid using static access to class '\NodejsPhpFallback\NodejsPhpFallback' in method 'renderWithJs'. Open
json_encode(realpath(NodejsPhpFallback::getPrefixPath() . '/require.js')) .
- 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
Avoid using static access to class 'Pug\Pug' in method '__callStatic'. Open
Pug::init();
- 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
Avoid unused parameters such as '$options'. Open
public function __invoke($code, array $options = null)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid using static access to class '\Phug\Phug' in method 'init'. 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
Avoid using static access to class '\Phug\Phug' in method 'addExtension'. 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
Avoid assigning values to variables in if clauses and the like (line '204', column '13'). Open
public function renderWithJs($input, $filename, $vars = null, $fallback = null)
{
if (is_array($filename)) {
if (!is_null($vars)) {
$fallback = $vars;
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid unused parameters such as '$compiler'. Open
public function __invoke(Filter $node, Compiler $compiler)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid using static access to class '\Phug\Phug' in method 'extractExtensionsFromKeywords'. Open
$options = array_merge($options, Phug::getExtensionsOptions([$keyword->getExtension()]));
- 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
Avoid unused parameters such as '$node'. Open
public function __invoke(Filter $node, Compiler $compiler)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Line exceeds 120 characters; contains 141 characters Open
if (!$this->getOption('strict') && strpos($input, "\n") === false && file_exists($input) && !is_dir($input) && is_readable($input)) {
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
'cacheFolderIsWritable' => !$this->getDefaultOption('cache_dir') || is_writable($this->getOption('cache_dir')),
- Exclude checks
Line exceeds 120 characters; contains 150 characters Open
throw new InvalidArgumentException($name . ' is not in the requirements list (' . implode(', ', array_keys($requirements)) . ')', 19);
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
throw new \RuntimeException('Pug\Filter\FilterInterface is no longer supported. Now use Pug\FilterInterface instead.');
- Exclude checks
Expected 0 spaces before closing bracket; newline found Open
$this->nodeEngine = new NodejsPhpFallback($this->hasOption('node_path')
- Exclude checks
Opening parenthesis of a multi-line function call must be the last content on the line Open
file_put_contents($renderFile,
- Exclude checks
Expected 0 spaces after opening bracket; newline found Open
if (
- Exclude checks
Expected 0 spaces before closing bracket; newline found Open
file_put_contents($optionsFile, 'module.exports = require(' .
- Exclude checks
Class extends undeclared class \Phug\Compiler
(Did you mean class \Jade\Compiler or class \Pug\Compiler) Open
class Compiler extends \Phug\Compiler
- Exclude checks
Class extends undeclared class \Phug\Renderer
(Did you mean class \Pug\Engine\Renderer) Open
abstract class Filters extends Renderer
- Exclude checks
Call to method getExtensionsOptions
from undeclared class \Phug\Phug
Open
$options = array_merge($options, Phug::getExtensionsOptions([$keyword->getExtension()]));
- Exclude checks