Skip to content

Specify types on get_parent_class() - #1383

Merged
ondrejmirtes merged 9 commits into
phpstan:1.8.xfrom
staabm:bug5552
Oct 5, 2022
Merged

ondrejmirtes merged 9 commits into
phpstan:1.8.xfrom
staabm:bug5552

Conversation

@staabm

@staabm staabm commented Jun 1, 2022 •

Copy link
Copy Markdown
Contributor

Comment thread src/Analyser/TypeSpecifier.php Resolved
@staabm staabm mentioned this pull request Sep 23, 2022
@staabm
staabm changed the base branch from 1.7.x to 1.8.x September 23, 2022 12:37
@clxmstaab
clxmstaab force-pushed the bug5552 branch 3 times, most recently from 63c70d3 to 823c7d0 Compare September 26, 2022 15:28
Comment thread src/Analyser/TypeSpecifier.php Outdated
Comment on lines 337 to 338

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this works arround the type error:

grafik

which is a separate bug, see #1396

@staabm staabm Sep 27, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

in fb01d17 I factored out the existing logic into 2 new private methods.

that way we don't run into the #1396 bug and don't need the is_string based workaround

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fyi @rvanvelzen, the refactoring might conflict with your existing #1761 PR.

@staabm
staabm marked this pull request as ready for review September 26, 2022 15:47
@clxmstaab
clxmstaab force-pushed the bug5552 branch 2 times, most recently from 3e7a923 to e91e1f1 Compare September 27, 2022 09:24
Comment thread src/Analyser/TypeSpecifier.php Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this if block is the only new logic of this PR.

everything else is pre-existing logic which was just factored out into new private methods

@staabm
staabm force-pushed the bug5552 branch 2 times, most recently from fb01d17 to eae128c Compare October 1, 2022 16:14
@staabm

staabm commented Oct 4, 2022

Copy link
Copy Markdown
Contributor Author

@ondrejmirtes if we could land this one it would unblock some of the already opened PRs for more TypeSpecifier goodness.

@ondrejmirtes ondrejmirtes changed the title specify types on get_parent_class() Specify types on get_parent_class() Oct 5, 2022
@ondrejmirtes
ondrejmirtes merged commit 0b8b337 into phpstan:1.8.x Oct 5, 2022
@ondrejmirtes

Copy link
Copy Markdown
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.

Support get_parent_class() in type specifier

3 participants