From 8ebaa0c53d99d4abd3c9efbd5e1028db7090aff9 Mon Sep 17 00:00:00 2001 From: Lisachenko Alexander Date: Sun, 15 Jan 2017 21:37:44 +0300 Subject: [PATCH] Fixed nullable parameter handling for 7.0, resolves #312 --- src/Proxy/AbstractProxy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Proxy/AbstractProxy.php b/src/Proxy/AbstractProxy.php index da9a4daa..9577a483 100644 --- a/src/Proxy/AbstractProxy.php +++ b/src/Proxy/AbstractProxy.php @@ -106,7 +106,7 @@ protected function getParameterCode(ReflectionParameter $parameter) if (PHP_VERSION_ID >= 70000) { $reflectionType = $parameter->getType(); if ($reflectionType) { - $nullablePrefix = $reflectionType->allowsNull() ? '?' : ''; + $nullablePrefix = (PHP_VERSION_ID >= 70100 && $reflectionType->allowsNull()) ? '?' : ''; $nsPrefix = $reflectionType->isBuiltin() ? '' : '\\'; $type = $nullablePrefix . $nsPrefix . (string) $reflectionType; }