From 7eb462bcf19abcae122855a6d79cc8f768c77880 Mon Sep 17 00:00:00 2001 From: mscherer Date: Tue, 30 Jul 2019 13:13:07 +0200 Subject: [PATCH] Fix false/true bool annotation. --- PSR2R/Sniffs/Commenting/DocBlockVarSniff.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PSR2R/Sniffs/Commenting/DocBlockVarSniff.php b/PSR2R/Sniffs/Commenting/DocBlockVarSniff.php index 6371fed..4f96b38 100644 --- a/PSR2R/Sniffs/Commenting/DocBlockVarSniff.php +++ b/PSR2R/Sniffs/Commenting/DocBlockVarSniff.php @@ -95,6 +95,10 @@ public function process(File $phpCsFile, $stackPointer) { if (in_array($defaultValueType, $parts, true)) { return; } + if ($defaultValueType === 'bool' && (in_array('true', $parts, true) || in_array('false', $parts, true))) { + return; + } + if ($defaultValueType === 'array' && strpos($content, '[]') !== false) { return; }