/** * @param Type $type * @return int|float|bool|string|array|object|null */ private function getValueForType(Type $type) { if ($type instanceof IntegerType) { return 0; } else { if ($type instanceof FloatType) { return 0.0; } else { if ($type instanceof BooleanType) { return false; } else { if ($type instanceof StringType) { return ''; } else { if ($type instanceof ArrayType) { return array(); } else { if ($type instanceof MultiType) { return $this->getValueForType($type->getTypes()[0]); } else { if ($type instanceof ClassType) { return (new Mockster($type->getClass(), $this->factory))->mock(); } else { return null; } } } } } } } }