diff --git a/vendor/magento/framework/Code/Generator/EntityAbstract.php b/vendor/magento/framework/Code/Generator/EntityAbstract.php index 215b13a4abc..8ccf26db333 100644 --- a/vendor/magento/framework/Code/Generator/EntityAbstract.php +++ b/vendor/magento/framework/Code/Generator/EntityAbstract.php @@ -10,6 +10,8 @@ use Magento\Framework\GetParameterClassTrait; /** * Abstract entity + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ abstract class EntityAbstract { @@ -18,7 +20,7 @@ abstract class EntityAbstract /** * Entity type abstract */ - const ENTITY_TYPE = 'abstract'; + public const ENTITY_TYPE = 'abstract'; /** * @var string[] @@ -332,14 +334,22 @@ abstract class EntityAbstract /** @var string|null $typeName */ $typeName = null; $parameterType = $parameter->getType(); - if ($parameterType->getName() === 'array') { + + if ($parameterType instanceof \ReflectionUnionType) { + $parameterType = $parameterType->getTypes(); + $parameterType = implode('|', $parameterType); + } else { + $parameterType = $parameterType->getName(); + } + + if ($parameterType === 'array') { $typeName = 'array'; } elseif ($parameterClass = $this->getParameterClass($parameter)) { $typeName = $this->_getFullyQualifiedClassName($parameterClass->getName()); - } elseif ($parameterType->getName() === 'callable') { + } elseif ($parameterType === 'callable') { $typeName = 'callable'; } else { - $typeName = $parameterType->getName(); + $typeName = $parameterType; } if ($parameter->allowsNull() && $typeName !== 'mixed') { diff --git a/vendor/magento/framework/Interception/Code/Generator/Interceptor.php b/vendor/magento/framework/Interception/Code/Generator/Interceptor.php index 0318ca7017e..4b8685facad 100644 --- a/vendor/magento/framework/Interception/Code/Generator/Interceptor.php +++ b/vendor/magento/framework/Interception/Code/Generator/Interceptor.php @@ -72,7 +72,7 @@ class Interceptor extends EntityAbstract $reflectionClass = new \ReflectionClass($this->getSourceClassName()); $publicMethods = $reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC); foreach ($publicMethods as $method) { - if ($this->isInterceptedMethod($method)) { + if (!$method->isInternal() && $this->isInterceptedMethod($method)) { $methods[] = $this->_getMethodInfo($method); } }