Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Feb 2, 2025
1 parent 2a94edb commit 0b28f60
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/Reflection/Php/PhpClassReflectionExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -528,16 +528,12 @@ private function createMethod(

if ($this->signatureMapProvider->hasMethodSignature($declaringClassName, $methodReflection->getName())) {
$variantsByType = ['positional' => []];
$reflectionMethod = null;
$throwType = null;
$asserts = Assertions::createEmpty();
$acceptsNamedArguments = true;
$selfOutType = null;
$phpDocComment = null;
if ($classReflection->getNativeReflection()->hasMethod($methodReflection->getName())) {
$reflectionMethod = $classReflection->getNativeReflection()->getMethod($methodReflection->getName());
}
$methodSignaturesResult = $this->signatureMapProvider->getMethodSignatures($declaringClassName, $methodReflection->getName(), $reflectionMethod);
$methodSignaturesResult = $this->signatureMapProvider->getMethodSignatures($declaringClassName, $methodReflection->getName(), $methodReflection);
foreach ($methodSignaturesResult as $signatureType => $methodSignatures) {
if ($methodSignatures === null) {
continue;
Expand Down Expand Up @@ -615,15 +611,15 @@ private function createMethod(
}
}
}
if ($stubPhpDocPair === null && $reflectionMethod !== null && $reflectionMethod->getDocComment() !== false) {
$filename = $reflectionMethod->getFileName();
if ($stubPhpDocPair === null && $methodReflection->getDocComment() !== false) {
$filename = $methodReflection->getFileName();
if ($filename !== false) {
$phpDocBlock = $this->fileTypeMapper->getResolvedPhpDoc(
$filename,
$declaringClassName,
null,
$reflectionMethod->getName(),
$reflectionMethod->getDocComment(),
$methodReflection->getName(),
$methodReflection->getDocComment(),
);
$throwsTag = $phpDocBlock->getThrowsTag();
if ($throwsTag !== null) {
Expand Down Expand Up @@ -655,7 +651,7 @@ private function createMethod(
}

$signatureParameters = $methodSignature->getParameters();
foreach ($reflectionMethod->getParameters() as $paramI => $reflectionParameter) {
foreach ($methodReflection->getParameters() as $paramI => $reflectionParameter) {
if (!array_key_exists($paramI, $signatureParameters)) {
continue;
}
Expand Down

0 comments on commit 0b28f60

Please sign in to comment.