Skip to content

[PropertyInfo] PhpStan extractor nested object fix #44637

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

Merged
merged 1 commit into from
Dec 26, 2021

Conversation

rmikalkenas
Copy link
Contributor

@rmikalkenas rmikalkenas commented Dec 15, 2021

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

PhpStanExtractor wrongly extracts object type when it is in a different namespace

@carsonbot
Copy link

Hey!

I think @Korbeil has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

Just some cs issues and GTM


return new NameScope($className, $namespace, $uses);
}

private function extractFromFullClassName(string $fullClassName): array
private function collectUses(\ReflectionClass $reflection): array
Copy link
Member

Choose a reason for hiding this comment

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

collectTraits would be a better name IMHO

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 think collectUses sounds more logic in this context, because method collects not only traits, but class uses as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nicolas-grekas rebased the branch, waiting for yours input on remaining issue

Copy link
Contributor

@Korbeil Korbeil left a comment

Choose a reason for hiding this comment

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

Apart from Nicolas CS fixes it looks good to me too 👍

@rmikalkenas rmikalkenas force-pushed the phpstan-extractor-fix branch from 2544689 to 78d51de Compare December 22, 2021 09:30
@nicolas-grekas
Copy link
Member

Thank you @rmikalkenas.

@nicolas-grekas nicolas-grekas merged commit fa99027 into symfony:5.4 Dec 26, 2021
This was referenced Dec 29, 2021
@rmikalkenas rmikalkenas deleted the phpstan-extractor-fix branch July 19, 2022 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants