Container::getComponents() returns incorrect type
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Start with stubs/ComponentModel/Container.stub and compare its declared return type with the component-model 3.1.0 behavior shown in commit 7f613eed7f5e57b6bde2d0be1bfdbb7e161620b3. Determine how older component-model versions should be handled, then update the conditional return type so shallow and deep calls match their actual results and verify the compatibility behavior.
Written by the indexing model from the issue text.
Description
component-model 3.1.0 returns array Container::getComponents() when $deep === false:
https://github.com/nette/component-model/commit/7f613eed7f5e57b6bde2d0be1bfdbb7e161620b3
instead of Iterator:
The return type should be something like
@phpstan-return (
$deep is true
? ($filterType is null ? array<int|string, \Nette\ComponentModel\IComponent> : array<int|string, T>)
: ($filterType is null ? \Iterator<int|string, \Nette\ComponentModel\IComponent> : \Iterator<int|string, T>)
)
I can open a PR but not sure what to do about older versions. Should I just add conflict with < 3.1.0?
- Dominant language
- PHP
- Stars
- 118
- Forks
- 44
- Avg merge
- 17d 5h
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from phpstan/phpstan-nette
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
phpstan/phpstan-nette#213 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
phpstan/phpstan-nette#147 · 1 comment ·
-
Dependency Dashboard Open
Difficulty 4/5 3-5 days Newbie friendliness 20/100
phpstan/phpstan-nette#94 ·
-
Form events errors Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
phpstan/phpstan-nette#82 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
phpstan/phpstan-nette#77 · 4 comments ·
All issues in phpstan/phpstan-nette
Similar issues
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
phpstan/phpstan-doctrine#794 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Automattic/static-site-importer#1767 ·