DIC parameter is interpreted as *never*
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with commit 2063d60f1bfe97c5702a839b3bc68d7f3fa75318 and reproduce the report using the container or builder getParameter calls shown in the issue. Trace why the array parameters are inferred as NEVER, then verify the PHPUnit assertions no longer report an unresolvable type or an always-false comparison.
Written by the indexing model from the issue text.
Description
Since commit https://github.com/phpstan/phpstan-symfony/commit/2063d60f1bfe97c5702a839b3bc68d7f3fa75318 I have a error that a dic parameter is never.
I am doing in the test code:
static::assertNotSame($this->container->getParameter('shopware.filesystem.public'), $this->container->getParameter('shopware.filesystem.theme'));
That both parameter keys which are arrays are the same. Since that commit I get
Parameter #1 $expected of static method PHPUnit\Framework\Assert::assertSame() contains unresolvable type.
I took the parameter out and "over-typed" it with an var annotation
/** @var array{type: string, config: array{root: string}} $filesystemPublic */
$filesystemPublic = $this->builder->getParameter('shopware.filesystem.public');
static::assertNotSame($filesystemPublic, $this->builder->getParameter('shopware.filesystem.theme'));
This produces that next strange error
72 Call to static method PHPUnit\Framework\Assert::assertSame() with *NEVER* and array{type: string, config: array{root: string}} will always evaluate to false.
72 Parameter #1 $expected of static method PHPUnit\Framework\Assert::assertSame() contains unresolvable type.
- Dominant language
- PHP
- Stars
- 800
- Forks
- 104
- Avg merge
- 4m
- 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-symfony
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
phpstan/phpstan-symfony#510 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
phpstan/phpstan-symfony#494 · 5 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
phpstan/phpstan-symfony#268 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
phpstan/phpstan-symfony#509 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
phpstan/phpstan-symfony#466 · 4 comments ·
All issues in phpstan/phpstan-symfony
Similar issues
-
sync-en
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
sync-en
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Перевод устарел
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
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 ·