From b41de178af28694ecf18568feec7bf713903ca57 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Wed, 7 Jul 2021 00:06:33 +0200 Subject: [PATCH] fix: suppress NonInvariantDocblockPropertyType on Command::$description --- src/Handlers/SuppressHandler.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Handlers/SuppressHandler.php b/src/Handlers/SuppressHandler.php index 9a9cc23..15b29b0 100644 --- a/src/Handlers/SuppressHandler.php +++ b/src/Handlers/SuppressHandler.php @@ -14,9 +14,16 @@ class SuppressHandler implements AfterClassLikeVisitInterface { $storage = $event->getStorage(); - // Commands: suppress PropertyNotSetInConstructor. - if (in_array(Command::class, $storage->parent_classes) && !in_array('PropertyNotSetInConstructor', $storage->suppressed_issues)) { - $storage->suppressed_issues[] = 'PropertyNotSetInConstructor'; + if (in_array(Command::class, $storage->parent_classes)) { + if (!in_array('PropertyNotSetInConstructor', $storage->suppressed_issues)) { + $storage->suppressed_issues[] = 'PropertyNotSetInConstructor'; + } + if (isset($storage->properties['description'])) { + $property = $storage->properties['description']; + if (!in_array('NonInvariantDocblockPropertyType', $property->suppressed_issues)) { + $property->suppressed_issues[] = 'NonInvariantDocblockPropertyType'; + } + } } // FormRequest: suppress PropertyNotSetInConstructor.