Skip to content

Conversation

@VincentLanglet
Copy link
Contributor

Comment on lines 69 to 71
$classReflection->hasNativeMethod('__call')
? $classReflection->getNativeMethod('__call')->getThrowType()
: null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For static methods this should look at __callStatic instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed

- 'PHPStan\Analyser\UndefinedVariableException'
- 'RuntimeException'
- 'Nette\Neon\Exception'
- 'Nette\MemberAccessException'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should no longer be necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, done

private array $parameters,
private bool $isStatic,
private bool $isVariadic,
private ?Type $throwType = null,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not need to be optional

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know if i needed to be BC. Changed.

);
}

$isStatic = $methodTags[$methodName]->isStatic();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're extracting this into a variable, you should use this variable on line 70.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot indeed, done

@ondrejmirtes ondrejmirtes changed the title Modify the built-in @method extension to look at @throws in __call. Modify the built-in @method extension to look at @throws in __call Oct 16, 2022
@ondrejmirtes ondrejmirtes merged commit ed1aff6 into phpstan:1.9.x Oct 16, 2022
@ondrejmirtes
Copy link
Member

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Looking for a way to improve @method and exceptions.

3 participants