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 6 times, most recently from 63db2fb to 6098601 Compare November 1, 2025 22:11
@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)

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.

2 participants