Showing 112 of 112 total issues
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
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 assigning values to variables in if clauses and the like (line '206', 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 '$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 '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 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 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 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 '\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
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
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 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
Expected 0 spaces after opening bracket; newline found Open
if (
- Exclude checks
Call to undeclared method \Pug\Engine\Filters::getCompiler
Open
return $this->getCompiler()->hasFilter($name);
- Exclude checks
Call to undeclared method \Pug\Engine\Filters::getCompiler
Open
$filter = $this->getCompiler()->getFilter($name);
- Exclude checks
Call to method __construct
from undeclared class \JsPhpize\JsPhpizePhug
Open
$compiler->addModule(new JsPhpizePhug($compiler));
- Exclude checks
Argument 1 (extension)
is \Phug\JsTransformerExtension
but \Pug\Engine\Options::addExtension()
takes \Phug\ExtensionInterface
defined at /code/src/Pug/Engine/Keywords.php:42
Open
$this->addExtension(new JsTransformerExtension());
- Exclude checks
Return type of getNodeEngine()
is undeclared type \NodejsPhpFallback\NodejsPhpFallback
Open
public function getNodeEngine()
- Exclude checks
Call to method execModuleScript
from undeclared class \NodejsPhpFallback\NodejsPhpFallback
Open
$result = $node->execModuleScript(
- Exclude checks