Showing 6 of 6 total issues
The method assertAboutPromise has a boolean flag argument $assertTrue, which is a certain sign of a Single Responsibility Principle violation. Open
Open
bool $assertTrue = true
- Read upRead up
- Exclude checks
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 '\React\EventLoop\Factory' in method 'eventLoop'. Open
Open
$this->loop = LoopFactory::create();
- 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
Only one argument is allowed per line in a multi-line function call Open
Open
$reasonExceptionClass, $reason, 'Failed asserting that promise rejects with a specified reason.'
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
Open
$reasonExceptionClass, $reason, 'Failed asserting that promise rejects with a specified reason.'
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
Open
public function assertPromiseRejectsWith(PromiseInterface $promise, string $reasonExceptionClass, int $timeout = null): void
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
Open
public function assertPromiseFulfillsWithInstanceOf(PromiseInterface $promise, string $class, int $timeout = null): void
- Exclude checks