ischenko/yii2-jsloader

View on GitHub
src/base/Config.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid assigning values to variables in if clauses and the like (line '50', column '19').
Open

    public function setAliases(array $aliases): ConfigInterface
    {
        foreach ($aliases as $name => $alias) {
            if (!($module = $this->getModule($name))) {
                $module = $this->addModule($name);
Severity: Minor
Found in src/base/Config.php by phpmd

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

Doc-block of $filter in getModules is phpdoc param type \ischenko\yii2\jsloader\FilterInterface which is not a permitted replacement of the nullable param type ?\ischenko\yii2\jsloader\FilterInterface declared in the signature ('?T' should be documented as 'T|null' or '?T')
Open

     * @param FilterInterface $filter filter to be used to select modules for matching conditions
Severity: Minor
Found in src/base/Config.php by phan

Possibly zero references to public property \ischenko\yii2\jsloader\base\Config->baseUrl
Open

    public $baseUrl;
Severity: Minor
Found in src/base/Config.php by phan

There are no issues that match your filters.

Category
Status