From e8f011600dd03bace4f29dca9e113c5a745c9d03 Mon Sep 17 00:00:00 2001 From: Tom Sowerby Date: Wed, 15 May 2019 08:57:38 +0100 Subject: [PATCH] Bug fix for multi-return types The block above checks return type and continues IF THERE IS A PROBLEM. If it's all fine then we end up checking the docblock against the return, which fails, and leads to a messy error message trying to parse an array. --- src/Check/ReturnCheck.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Check/ReturnCheck.php b/src/Check/ReturnCheck.php index 85c7431..608404b 100644 --- a/src/Check/ReturnCheck.php +++ b/src/Check/ReturnCheck.php @@ -46,7 +46,7 @@ public function check(FileInfo $file) } } - if ($method['docblock']['return'] !== $method['return']) { + if (!is_array($method['return']) && $method['docblock']['return'] !== $method['return']) { if ($method['return'] === 'array' && substr($method['docblock']['return'], -2) === '[]') { // Do nothing because this is fine. } else {