src/Repository/Builder/Metadata/ManyToOne.php
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
string $fieldName,
string $propertyName,
string $targetTable,
string $targetEntity,
string $targetPropertyName,
The method __construct has a boolean flag argument $readOnly, which is a certain sign of a Single Responsibility Principle violation. Open
Open
bool $readOnly = false,
- 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
The method __construct has a boolean flag argument $eagerHydration, which is a certain sign of a Single Responsibility Principle violation. Open
Open
bool $eagerHydration = false
- 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 '\Assert\Assertion' in method 'getTargetInterfaceName'. Open
Open
Assertion::notNull(
$this->targetInterfaceName,
sprintf('Target entity %s has no interface name defined', $this->targetEntity)
);
- 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();
}
}