diff --git a/vendor/magento/framework/Async/Code/Generator/ProxyDeferredGenerator.php b/vendor/magento/framework/Async/Code/Generator/ProxyDeferredGenerator.php index c536c55fdfcc..859a66447007 100644 --- a/vendor/magento/framework/Async/Code/Generator/ProxyDeferredGenerator.php +++ b/vendor/magento/framework/Async/Code/Generator/ProxyDeferredGenerator.php @@ -246,7 +246,7 @@ private function getReturnTypeValue(\ReflectionMethod $method): ?string $returnTypeValue = null; $returnType = $method->getReturnType(); if ($returnType) { - $returnTypeValue = ($returnType->allowsNull() ? '?' : ''); + $returnTypeValue = ($returnType->allowsNull() && $returnType->getName() !== 'mixed' ? '?' : ''); $returnTypeValue .= ($returnType->getName() === 'self') ? $this->_getFullyQualifiedClassName($method->getDeclaringClass()->getName()) : $returnType->getName(); diff --git a/vendor/magento/framework/Code/Generator/EntityAbstract.php b/vendor/magento/framework/Code/Generator/EntityAbstract.php index 0e440909d86c..8ccf26db333d 100644 --- a/vendor/magento/framework/Code/Generator/EntityAbstract.php +++ b/vendor/magento/framework/Code/Generator/EntityAbstract.php @@ -352,7 +352,7 @@ private function extractParameterType( $typeName = $parameterType; } - if ($parameter->allowsNull()) { + if ($parameter->allowsNull() && $typeName !== 'mixed') { $typeName = '?' . $typeName; } diff --git a/vendor/magento/framework/Interception/Code/Generator/Interceptor.php b/vendor/magento/framework/Interception/Code/Generator/Interceptor.php index c363f808776c..4b8685facad7 100644 --- a/vendor/magento/framework/Interception/Code/Generator/Interceptor.php +++ b/vendor/magento/framework/Interception/Code/Generator/Interceptor.php @@ -212,7 +212,7 @@ private function getReturnTypeValue(\ReflectionMethod $method): ?string $returnTypeValue = null; $returnType = $method->getReturnType(); if ($returnType) { - $returnTypeValue = ($returnType->allowsNull() ? '?' : ''); + $returnTypeValue = ($returnType->allowsNull() && $returnType->getName() !== 'mixed' ? '?' : ''); $returnTypeValue .= ($returnType->getName() === 'self') ? $this->_getFullyQualifiedClassName($method->getDeclaringClass()->getName()) : $returnType->getName(); diff --git a/vendor/magento/framework/ObjectManager/Code/Generator/Proxy.php b/vendor/magento/framework/ObjectManager/Code/Generator/Proxy.php index a45795e5df16..f9bf616681cb 100644 --- a/vendor/magento/framework/ObjectManager/Code/Generator/Proxy.php +++ b/vendor/magento/framework/ObjectManager/Code/Generator/Proxy.php @@ -1,7 +1,5 @@ getReturnType(); if ($returnType) { - $returnTypeValue = ($returnType->allowsNull() ? '?' : ''); + $returnTypeValue = ($returnType->allowsNull() && $returnType->getName() !== 'mixed' ? '?' : ''); $returnTypeValue .= ($returnType->getName() === 'self') ? $this->_getFullyQualifiedClassName($method->getDeclaringClass()->getName()) : $returnType->getName();