src/StaticAddToTrait.php

Summary

Maintainability
A
0 mins
Test Coverage

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

    public static function addToWithClUnsafe(object $parent, $seed = [], array $addArgs = [], bool $skipAdd = false)
Severity: Minor
Found in src/StaticAddToTrait.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 addToWithCl has a boolean flag argument $skipAdd, which is a certain sign of a Single Responsibility Principle violation.
Open

    public static function addToWithCl(object $parent, $seed = [], array $addArgs = [], bool $skipAdd = false)// :static supported by PHP8+
Severity: Minor
Found in src/StaticAddToTrait.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 addTo has a boolean flag argument $skipAdd, which is a certain sign of a Single Responsibility Principle violation.
Open

    public static function addTo(object $parent, array $defaults = [], array $addArgs = [], bool $skipAdd = false)// :static supported by PHP8+
Severity: Minor
Found in src/StaticAddToTrait.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 _addToAdd has a boolean flag argument $skipAdd, which is a certain sign of a Single Responsibility Principle violation.
Open

    private static function _addToAdd(object $parent, object $object, array $addArgs, bool $skipAdd = false): void
Severity: Minor
Found in src/StaticAddToTrait.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

Line exceeds 120 characters; contains 139 characters
Open

    public static function addToWithCl(object $parent, $seed = [], array $addArgs = [], bool $skipAdd = false)// :static supported by PHP8+
Severity: Minor
Found in src/StaticAddToTrait.php by phpcodesniffer

The method _addToAdd is not named in camelCase.
Open

    private static function _addToAdd(object $parent, object $object, array $addArgs, bool $skipAdd = false): void
    {
        if (!$skipAdd) {
            $parent->add($object, ...$addArgs);
        }
Severity: Minor
Found in src/StaticAddToTrait.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status