Skip to content

Commit

Permalink
Simplify empty array check
Browse files Browse the repository at this point in the history
  • Loading branch information
carusogabriel authored and sebastianbergmann committed Nov 5, 2018
1 parent bcbb5e0 commit 55a0862
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Framework/MockObject/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Util/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 55a0862

Please sign in to comment.