Skip to content

Commit e06abdb

Browse files
committed
Fix DefaultValue sniff
1 parent 8aedfdc commit e06abdb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

PhpCollective/Sniffs/Commenting/DocBlockParamAllowDefaultValueSniff.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function process(File $phpCsFile, $stackPointer): void
100100
continue;
101101
}
102102

103-
if ($methodSignatureValue['typehint'] && in_array($methodSignatureValue['typehint'], ['array', 'iterable', 'string', 'int', 'bool', 'float', 'self', 'parent'], true)) {
103+
if ($methodSignatureValue['typehint'] && in_array($methodSignatureValue['typehint'], ['array', 'iterable', 'string', 'int', 'bool', 'float', 'self', 'parent', 'false', 'true'], true)) {
104104
$type = $methodSignatureValue['typehint'];
105105
if (
106106
!$this->containsType($type, $parts)
@@ -205,6 +205,7 @@ protected function containsType(string $type, array $parts): bool
205205
$longTypes = [
206206
'int' => 'integer',
207207
'bool' => 'boolean',
208+
'array' => 'iterable',
208209
];
209210
if (!isset($longTypes[$type])) {
210211
return false;

0 commit comments

Comments
 (0)