private static function getMockReflection($mockedClass)
{
if (!class_exists($mockedClass) and !interface_exists($mockedClass)) {
throw self::generateException("Mocking failed `{$mockedClass}` No such class or interface");
}
$reflection = new \ReflectionClass($mockedClass);
if ($reflection->isFinal()) {
throw self::generateException("Unable to mock class {$mockedClass} declared as final");
}
return $reflection;
}