Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat methods of internal or psalm internal classes as internal #3698

Merged
merged 1 commit into from
Jun 28, 2020

Conversation

bdsl
Copy link
Contributor

@bdsl bdsl commented Jun 27, 2020

When both the method and the class are annotated as psalm-internal,
but to different namespaces, we consider the method internal to
whichever namespace is longer, i.e. the smaller code module.

Issue reported at #3457 by @skolman

I'd also like to gauge interest in @internal and @psalm-internal more generally. If people think it would be useful I could do some more work on catching the issues in the second list at #1623 (comment)

When both the method and the class are annotated as psalm-internal,
but to different namespaces, we consider the method internal to
whichever namespace is longer, i.e. the smaller code module.

Issue reported at vimeo#3457
@@ -2133,6 +2134,12 @@ private function registerFunctionLike(PhpParser\Node\FunctionLike $stmt, $fake_m

$doc_comment = $stmt->getDocComment();


if ($class_storage && ! $class_storage->is_trait) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't take the internal nature of the trait into account, because that would fail these existing test cases for valid code:

'internalMethodInTraitWithCall' => [
'internalMethodInTraitWithCall' => [

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.

None yet

2 participants