The method getType has a boolean flag argument $outputType, which is a certain sign of a Single Responsibility Principle violation. Open
public function getType(PropertyInterface $property, bool $outputType = false): string
- 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 isPropertyNullable has a boolean flag argument $outputType, which is a certain sign of a Single Responsibility Principle violation. Open
public function isPropertyNullable(PropertyInterface $property, bool $outputType = false): bool
- 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 getTypeHintAnnotation has a boolean flag argument $outputType, which is a certain sign of a Single Responsibility Principle violation. Open
public function getTypeHintAnnotation(PropertyInterface $property, bool $outputType = false): string
- 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 resolvePropertyDecorator has a boolean flag argument $nestedProperty, which is a certain sign of a Single Responsibility Principle violation. Open
public function resolvePropertyDecorator(PropertyInterface $property, bool $nestedProperty = false): string
- 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 PHPModelGenerator\Utils\count() function in for loops. Open
for ($i = 0; $i < count($schema->getMethods()); $i++) {
$renderedMethods .= $schema->getMethods()[array_keys($schema->getMethods())[$i]]->getCode() . "\n\n";
}
- Read upRead up
- Exclude checks
CountInLoopExpression
Since: 2.7.0
Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.
Example
class Foo {
public function bar()
{
$array = array();
for ($i = 0; count($array); $i++) {
// ...
}
}
}
Source https://phpmd.org/rules/design.html#countinloopexpression
syntax error, unexpected 'protected' (T_PROTECTED), expecting variable (T_VARIABLE)
Open
public function __construct(protected GeneratorConfiguration $generatorConfiguration) {}
- Exclude checks
Opening brace should be on a new line Open
public function __construct(protected GeneratorConfiguration $generatorConfiguration) {}
- Exclude checks
Closing brace must be on a line by itself Open
public function __construct(protected GeneratorConfiguration $generatorConfiguration) {}
- Exclude checks