diff --git a/src/Framework/MockObject/Generator/Generator.php b/src/Framework/MockObject/Generator/Generator.php index 0ac13fb1cc1..9f023be3cfa 100644 --- a/src/Framework/MockObject/Generator/Generator.php +++ b/src/Framework/MockObject/Generator/Generator.php @@ -776,7 +776,7 @@ private function generateCodeForTestDoubleClass(string $type, bool $mockObject, if (is_array($explicitMethods)) { foreach ($explicitMethods as $methodName) { - if ($class !== null && $class->hasMethod($methodName)) { + if ($class->hasMethod($methodName)) { $method = $class->getMethod($methodName); if ($this->canMethodBeDoubled($method)) {