File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed
tests/PHPStan/Rules/Methods Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -415,13 +415,13 @@ private function createMethod(
415415 $ stubPhpDocString = null ;
416416 $ variants = [];
417417 $ reflectionMethod = null ;
418- if (class_exists ($ classReflection ->getName (), false )) {
418+ if ($ classReflection ->getNativeReflection ()->hasMethod ($ methodReflection ->getName ())) {
419+ $ reflectionMethod = $ classReflection ->getNativeReflection ()->getMethod ($ methodReflection ->getName ());
420+ } elseif (class_exists ($ classReflection ->getName (), false )) {
419421 $ reflectionClass = new \ReflectionClass ($ classReflection ->getName ());
420422 if ($ reflectionClass ->hasMethod ($ methodReflection ->getName ())) {
421423 $ reflectionMethod = $ reflectionClass ->getMethod ($ methodReflection ->getName ());
422424 }
423- } else {
424- $ reflectionMethod = $ classReflection ->getNativeReflection ()->getMethod ($ methodReflection ->getName ());
425425 }
426426 foreach ($ variantNames as $ innerVariantName ) {
427427 $ methodSignature = $ this ->signatureMapProvider ->getFunctionSignature ($ innerVariantName , $ declaringClassName );
Original file line number Diff line number Diff line change @@ -336,4 +336,10 @@ public function testBug3443(): void
336336 $ this ->analyse ([__DIR__ . '/data/bug-3443.php ' ], []);
337337 }
338338
339+ public function testBug3478 (): void
340+ {
341+ $ this ->phpVersionId = PHP_VERSION_ID ;
342+ $ this ->analyse ([__DIR__ . '/data/bug-3478.php ' ], []);
343+ }
344+
339345}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Bug3478 ;
4+
5+ class ExtendedDocument extends \DOMDocument
6+ {
7+ public function saveHTML (\DOMNode $ node = null )
8+ {
9+ return parent ::saveHTML ($ node );
10+ }
11+ }
You can’t perform that action at this time.
0 commit comments