diff --git a/src/ObjectCalisthenics/Rules/NoShortNameRule.php b/src/ObjectCalisthenics/Rules/NoShortNameRule.php index 505ad4af..7c83cda3 100644 --- a/src/ObjectCalisthenics/Rules/NoShortNameRule.php +++ b/src/ObjectCalisthenics/Rules/NoShortNameRule.php @@ -36,7 +36,7 @@ final class NoShortNameRule extends AbstractSymplifyRule implements Configurable */ public function __construct( private readonly int $minNameLength, - private readonly array $allowedShortNames = ['i', 'j', 'y', 'z'] + private readonly array $allowedShortNames = ['i', 'j', 'y', 'z', 'd', 'dd'] ) { } @@ -130,6 +130,9 @@ private function isNameValid(string $name): bool return true; } + dump($name); + dump(in_array($name, $this->allowedShortNames, true)); + return in_array($name, $this->allowedShortNames, true); } } diff --git a/tests/ObjectCalisthenics/Rules/NoShortNameRule/Fixture/AllowD.php b/tests/ObjectCalisthenics/Rules/NoShortNameRule/Fixture/AllowD.php new file mode 100644 index 00000000..1ad227fd --- /dev/null +++ b/tests/ObjectCalisthenics/Rules/NoShortNameRule/Fixture/AllowD.php @@ -0,0 +1,8 @@ +