src/Cmixin/BusinessDay/MixinBase.php
The method skipMissingCalendarExtensionException has a boolean flag argument $skipped, which is a certain sign of a Single Responsibility Principle violation. Open
Open
public static function skipMissingCalendarExtensionException(bool $skipped = true): void
- 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
Instantiation of abstract class \Cmixin\BusinessDay\MixinBase
Open
Open
$mixin = new static();
- Exclude checks
Avoid excessively long variable names like $missingCalendarExtensionExceptionSkipped. Keep variable name length under 20. Open
Open
private static $missingCalendarExtensionExceptionSkipped = false;
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $missingCalendarExtensionExceptionSkipped. Keep variable name length under 20. Open
Open
private static $missingCalendarExtensionExceptionSkipped = false;
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}