From 55a0862af4d7c17cfcc6acf97cd8c68f9d6eb72f Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Sun, 4 Nov 2018 21:20:54 -0200 Subject: [PATCH] Simplify empty array check --- src/Framework/MockObject/Generator.php | 2 +- src/Util/Test.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Framework/MockObject/Generator.php b/src/Framework/MockObject/Generator.php index 51988fb685e..351ed913f1d 100644 --- a/src/Framework/MockObject/Generator.php +++ b/src/Framework/MockObject/Generator.php @@ -772,7 +772,7 @@ private function generateMock($type, $explicitMethods, $mockClassName, $callOrig $cloneTemplate = $cloneTemplate->render(); } - if (\is_array($explicitMethods) && empty($explicitMethods) && + if ($explicitMethods === [] && ($isClass || $isInterface)) { $mockMethods->addMethods( ...$this->mockClassMethods($mockClassName['fullClassName'], $callOriginalMethods, $cloneArguments) diff --git a/src/Util/Test.php b/src/Util/Test.php index c0c1ec78f63..e069c2025ee 100644 --- a/src/Util/Test.php +++ b/src/Util/Test.php @@ -413,7 +413,7 @@ public static function getProvidedData(string $className, string $methodName): ? $data = self::getDataFromTestWithAnnotation($docComment); } - if (\is_array($data) && empty($data)) { + if ($data === []) { throw new SkippedTestError; }