Closed VincentLanglet closed 1 year ago
$data['sniffs'] is just mixed[]
I presume?
ah wait, but my changes are still unreleased. that means most likely that https://github.com/phpstan/phpstan-webmozart-assert/blob/1.2.1/src/Type/WebMozartAssert/AssertTypeSpecifyingExtension.php#L454-L456 is the reason with the released version and, since you also get it with 1.2.x, subclassOf
might be the problem afterwards. strange
I'll have to re-create this in a test and debug later.
$data['sniffs'] is just
mixed[]
I presume?
Yes, I have previous checks
Assert::isArray($data);
Assert::keyExists($data, 'sniffs');
Assert::isArray($data['sniffs']);
ah wait, but my changes are still unreleased. that means most likely that https://github.com/phpstan/phpstan-webmozart-assert/blob/1.2.1/src/Type/WebMozartAssert/AssertTypeSpecifyingExtension.php#L454-L456 is the reason with the released version and, since you also get it with 1.2.x, subclassOf might be the problem afterwards. strange
I'll have to re-create this in a test and debug later.
Dunno if it help, but
Assert::isAOf($sniffName, SniffInterface::class);
is working fine
interestingly my test cases are green here, can you check the linked PR if you do anything different or I missed anything? I'm both asserting types and doing the impossible checks with strict rules on 🤔
Dunno if it can help you, but my error is on an open source project: https://github.com/VincentLanglet/Twig-CS-Fixer/blob/main/src/Cache/CacheEncoder.php#L40 ignored here: https://github.com/VincentLanglet/Twig-CS-Fixer/blob/main/phpstan.neon#L40
I think this was fixed on develop. I know you wrote you tested it, but I could verify that it errors exactly like that if I revert a specific commit
I think this was fixed on develop
I just tried again, and indeed I don't have the error with
"phpstan/phpstan": "1.9.x-dev as 1.9.0",
"phpstan/phpstan-webmozart-assert": "1.2.x-dev as 1.2.2",
I dunno how I messed up the first time. Sorry for the inconvenient.
no worries, a double-check and another test case here don't hurt :)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
With the following code
I get
i tried to install
but it doesn't solved anything
I saw you recently work on this method @herndlm (https://github.com/phpstan/phpstan-webmozart-assert/pull/144), any idea what could be wrong here ?