@@ -119,7 +119,7 @@ protected function reflectElementType()
119119 $ elementTypeClass = new \ReflectionClass ($ elementType );
120120 $ this ->class ->addUse ($ elementType );
121121 $ getAtMethod = $ reflectionClass ->getMethod ('getAt ' );
122- if ($ getAtMethod ->getDeclaringClass ()-> getName () != $ this ->class ->getClassName ()) {
122+ if ($ getAtMethod ->class != $ this ->class ->getClassName ()) {
123123 $ this ->class ->addMagicMethod (
124124 'getAt ' ,
125125 ['$offset ' ],
@@ -131,7 +131,7 @@ protected function reflectElementType()
131131 );
132132 }
133133 $ getByIdMethod = $ reflectionClass ->getMethod ('getById ' );
134- if ($ getByIdMethod ->getDeclaringClass ()-> getName () != $ this ->class ->getClassName ()) {
134+ if ($ getByIdMethod ->class != $ this ->class ->getClassName ()) {
135135 $ elementTypeObject = $ elementTypeClass ->newInstanceWithoutConstructor ();
136136 if ($ elementTypeObject instanceof JsonObject && isset ($ elementTypeObject ->fieldDefinitions ()['id ' ])) {
137137 $ this ->class ->addMagicMethod (
@@ -146,7 +146,7 @@ protected function reflectElementType()
146146 }
147147 }
148148 $ addMethod = $ reflectionClass ->getMethod ('add ' );
149- if ($ addMethod ->getDeclaringClass ()-> getName () != $ this ->class ->getClassName ()) {
149+ if ($ addMethod ->class != $ this ->class ->getClassName ()) {
150150 $ this ->class ->addMagicMethod (
151151 'add ' ,
152152 [$ elementTypeClass ->getShortName () . ' $element ' ],
@@ -158,7 +158,7 @@ protected function reflectElementType()
158158 );
159159 }
160160 $ current = $ reflectionClass ->getMethod ('current ' );
161- if ($ current ->getDeclaringClass ()-> getName () != $ this ->class ->getClassName ()) {
161+ if ($ current ->class != $ this ->class ->getClassName ()) {
162162 $ this ->class ->addMagicMethod (
163163 'current ' ,
164164 [],
@@ -186,7 +186,7 @@ protected function reflectResultClass()
186186 $ resultClassReflection = new \ReflectionClass ($ resultClass );
187187 $ this ->class ->addUse ($ resultClass );
188188 $ mapResponseMethod = $ reflectionClass ->getMethod ('mapResponse ' );
189- if ($ mapResponseMethod ->getDeclaringClass ()-> getName () != $ this ->class ->getClassName ()) {
189+ if ($ mapResponseMethod ->class != $ this ->class ->getClassName ()) {
190190 $ this ->class ->addUse (ApiResponseInterface::class);
191191 $ this ->class ->addMagicMethod (
192192 'mapResponse ' ,
0 commit comments