SAREhub/EasyECA

View on GitHub
src/SAREhub/EasyECA/Event/DefaultEventTypeRuleGroupsSplittingStrategy.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class '\SAREhub\Commons\Misc\ArrayHelper' in method 'groupRulesByEventType'.
Open

        return ArrayHelper::groupByKey($rules, "event");

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 '\SAREhub\Client\Message\BasicMessage' in method 'splitRulesByEventType'.
Open

            $splits[] = BasicExchange::withIn(BasicMessage::withBody($definition));

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 '\SAREhub\Client\Message\BasicExchange' in method 'splitRulesByEventType'.
Open

            $splits[] = BasicExchange::withIn(BasicMessage::withBody($definition));

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 excessively long class names like DefaultEventTypeRuleGroupsSplittingStrategy. Keep class name length under 40.
Open

class DefaultEventTypeRuleGroupsSplittingStrategy implements SplittingStrategy
{
    /**
     * @var EventRuleGroupDefinitionFactory
     */

LongClassName

Since: 2.9

Detects when classes or interfaces are declared with excessively long names.

Example

class ATooLongClassNameThatHintsAtADesignProblem {

}

interface ATooLongInterfaceNameThatHintsAtADesignProblem {

}

Source https://phpmd.org/rules/naming.html#longclassname

The closing brace for the class must go on the next line after the body
Open

}

Expected 1 newline at end of file; 0 found
Open

}

There are no issues that match your filters.

Category
Status