Skip to content

Commit 90c3a7a

Browse files
committed
Improve ElementNameMinimalLengthSniff
1 parent 0d38495 commit 90c3a7a

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Inpsyde/Sniffs/CodeQuality/ElementNameMinimalLengthSniff.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,17 @@ final class ElementNameMinimalLengthSniff implements Sniff
3434
/**
3535
* @var string[]
3636
*/
37-
public $allowedShortNames = ['i', 'id', 'to', 'up', 'ok', 'no', 'go', 'it'];
37+
public $allowedShortNames = [
38+
'i',
39+
'id',
40+
'to',
41+
'up',
42+
'ok',
43+
'no',
44+
'go',
45+
'it',
46+
'db',
47+
];
3848

3949
/**
4050
* @return int[]
@@ -95,6 +105,10 @@ private function shouldBeSkipped(
95105
*/
96106
private function isShortNameAllowed(string $variableName): bool
97107
{
98-
return in_array($variableName, $this->allowedShortNames);
108+
return in_array(
109+
strtolower($variableName),
110+
$this->allowedShortNames,
111+
true
112+
);
99113
}
100114
}

0 commit comments

Comments
 (0)