laminas-code icon indicating copy to clipboard operation
laminas-code copied to clipboard

Issue with extending \ArrayObject

Open mohaelmrabet opened this issue 2 years ago • 3 comments

Bug Report

Q A
Version(s) 4.10.0
PHP version 8.1

Summary

Create a simple class whe extend \ArrayObjec e.g. class Param extends \ArrayObject {} and after create a class who inject thi class in his l'une de ces method. class Bug { public function test(Param $param) { } } If we try to fdo a reflection with this class/method we git this error

Current behavior

We got the error: Call to undefined method ReflectionUnionType::isBuiltin()#0

How to reproduce

Create a simple class that extends the \ArrayObject class, eg:

class Param extends \ArrayObject {}

and then you have to create a class that injects this class in one of its methods, eg:

class Bug { public function test(Param $param) { } }

And then you have to try to do a reflection with this class/method using Laminas Reflection

see here https://github.com/magento/magento2/issues/35448

mohaelmrabet avatar May 14 '23 12:05 mohaelmrabet

Hello,

if you are interested he can offer a fix and send a PR

mohaelmrabet avatar May 14 '23 13:05 mohaelmrabet

Do please feel free to send a patch against 4.11.x (testa though!)

Ocramius avatar May 14 '23 14:05 Ocramius

@mimou78, you don't share fix ?

kallard1 avatar Jun 23 '23 14:06 kallard1