Showing 1,792 of 1,794 total issues

Missing class import via use statement (line '83', column '23').
Open

            throw new \TypeError('$fx must be of type Closure');
Severity: Minor
Found in src/Loader.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

Missing class import via use statement (line '76', column '23').
Open

            throw new \TypeError('$fx must be of type Closure');
Severity: Minor
Found in src/Modal.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

The method setHoverable has a boolean flag argument $isOverable, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function setHoverable(bool $isOverable = true)
Severity: Minor
Found in src/Popup.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method atomicSession has a boolean flag argument $readAndCloseImmediately, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function atomicSession(\Closure $fx, bool $readAndCloseImmediately = false)
Severity: Minor
Found in src/SessionTrait.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Missing class import via use statement (line '162', column '49').
Open

                        $value->setTimezone(new \DateTimeZone($this->timezone));
Severity: Minor
Found in src/Persistence/Ui.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

The method addButton has a boolean flag argument $isDisabled, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function addButton($button, $action = null, string $confirmMsg = '', $isDisabled = false)
Severity: Minor
Found in src/Table/Column/ActionButtons.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Missing class import via use statement (line '120', column '29').
Open

                $date = new \DateTime('+' . $this->get('number_days') . ' days');

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

Missing class import via use statement (line '135', column '23').
Open

            throw new \TypeError('$fx must be of type Closure');
Severity: Minor
Found in src/Popup.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

Missing class import via use statement (line '128', column '23').
Open

            if (((new \ReflectionProperty(self::class, 'model'))->isInitialized($this) ? $this->model : $this->entity) === $model) {
Severity: Minor
Found in src/View.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

The method registerCaption has a boolean flag argument $isSpecific, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function registerCaption(UserAction $action, string $caption, bool $isSpecific = false, ?string $type = null): void
Severity: Minor
Found in src/UserAction/ExecutorFactory.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

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

        if (((new \ReflectionProperty(self::class, 'model'))->isInitialized($this) ? $this->model : $this->entity) !== null) {
Severity: Minor
Found in src/View.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

The method registerTrigger has a boolean flag argument $isSpecific, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function registerTrigger(string $type, $seed, UserAction $action, bool $isSpecific = false): void
Severity: Minor
Found in src/UserAction/ExecutorFactory.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Missing class import via use statement (line '48', column '23').
Open

            throw new \TypeError('$fx must be of type Closure');
Severity: Minor
Found in src/VirtualPage.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

The method js has a boolean flag argument $when, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function js($when = false, $action = null, $selector = null): ?JsExpressionable
Severity: Minor
Found in src/View.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method jsAddStoreData has a boolean flag argument $useSession, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function jsAddStoreData(array $data, bool $useSession = false): JsExpressionable
Severity: Minor
Found in src/View.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Missing class import via use statement (line '111', column '40').
Open

        if ($name === 'model' && !(new \ReflectionProperty(self::class, 'model'))->isInitialized($this) && $this->entity !== null) {
Severity: Minor
Found in src/View.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

The method jsClearStoreData has a boolean flag argument $useSession, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function jsClearStoreData(bool $useSession = false): JsExpressionable
Severity: Minor
Found in src/View.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Avoid using static access to class 'Atk4\Ui\VirtualPage' in method 'addSection'.
Open

            $section->virtualPage = VirtualPage::addTo($section, ['ui' => '']);
Severity: Minor
Found in src/Accordion.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

The method closeSession uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $res = session_abort();
        }
Severity: Minor
Found in src/App/SessionManager.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method forget uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                unset($_SESSION[$this->rootNamespace][$namespace][$key]);
            }
Severity: Minor
Found in src/App/SessionManager.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Severity
Category
Status
Source
Language