Skip to content

Conversation

@VincentLanglet
Copy link
Contributor

Cf #246 (comment)

I did ignoreMissingDataProviderReturnType rather than reportMissingDataProviderReturnType because it allows to write

	PHPStan\Type\PHPUnit\DataProviderReturnTypeIgnoreExtension:
		phpstan.ignoreErrorExtension: [%featureToggles.bleedingEdge%, %phpunit.ignoreMissingDataProviderReturnType%]

and I dunno how a syntax

	PHPStan\Type\PHPUnit\DataProviderReturnTypeIgnoreExtension:
		phpstan.ignoreErrorExtension: [%featureToggles.bleedingEdge%, NOT(%phpunit.reportMissingDataProviderReturnType%)]

would exists

@VincentLanglet VincentLanglet force-pushed the ignoreMissingDataProviderReturnType branch 7 times, most recently from 6098601 to 5dbdbc3 Compare November 1, 2025 22:17
@ondrejmirtes
Copy link
Member

"ignoreMissing" is a double negative. It requires a lot of mental gymnastics to figure out "do I need true or false for what I want?". That's why reportMissingDataProviderReturnType is a lot more natural.

AFAIK not(...) should work as expected: https://doc.nette.org/en/dependency-injection/services#toc-special-functions

If it doesn't we need to do some work in phpstan-src to enable that.

@VincentLanglet VincentLanglet changed the title Remove checkDataProviderData and introduce ignoreMissingDataProviderReturnType Remove checkDataProviderData and introduce reportMissingDataProviderReturnType Nov 1, 2025
@VincentLanglet
Copy link
Contributor Author

AFAIK not(...) should work as expected: doc.nette.org/en/dependency-injection/services#toc-special-functions

If it doesn't we need to do some work in phpstan-src to enable that.

I'm getting

Invalid configuration:
The item 'conditionalTags › PHPStan\Type\PHPUnit\DataProviderReturnTypeIgnoreExtension › phpstan.ignoreErrorExtension › 1' expects to be bool, object _PHPStan_f0675a7b6\Nette\DI\Definitions\Statement given.

with not(%phpunit.reportMissingDataProviderReturnType%)

or maybe am I doing it wrong ?

@ondrejmirtes
Copy link
Member

Yeah, that's what I'm talking about, some amends need to be made in phpstan-src first.

@VincentLanglet
Copy link
Contributor Author

Ok, so I'll try to introduce this syntax on phpstan-src (with phpstan/phpstan-src#4512)

@ondrejmirtes
Copy link
Member

You can now take advantage of this here 😊

@VincentLanglet VincentLanglet force-pushed the ignoreMissingDataProviderReturnType branch from e876871 to f2e12e1 Compare November 11, 2025 15:46
@VincentLanglet
Copy link
Contributor Author

You can now take advantage of this here 😊

Nice, Ci is green

@VincentLanglet
Copy link
Contributor Author

Friendly ping @ondrejmirtes I'd like to use this option :)

@ondrejmirtes ondrejmirtes merged commit 8d61a58 into phpstan:2.0.x Dec 6, 2025
70 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

@LastDragon-ru
Copy link

LastDragon-ru commented Dec 7, 2025

@ondrejmirtes , @VincentLanglet how to disable this rule??? I do not have a time (and the desire to be honest) to fix "Found 354 errors" now nor to add them into baseline :|

@ondrejmirtes
Copy link
Member

@LastDragon-ru Do not use bleeding edge, or put them into the baseline.

LastDragon-ru added a commit to LastDragon-ru/lara-asp that referenced this pull request Dec 7, 2025
LastDragon-ru added a commit to LastDragon-ru/lara-asp that referenced this pull request Dec 7, 2025
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.

3 participants