Issue Task Closed

#109152phpstan: disable treatPhpDocTypesAsCertain

Benni Mack 03/04/26, 12:49 updated 03/31/26, 08:09

Description

Why should we do this?

1. We don’t have strict / native PHP types everywhere, and thus
need to check for e.g. “is_array()” even though the type hint
says “@param array”. This is a breaking change if we’d change
this but right now “not a bug” for us.

2. “non-empty-string” options are currently not helpful for TYPO3
as a framework, as we expect a “non-empty-string” but user-land
code might still hand in an empty string so we do need to check for
such cases.

3. narrowed types such as “$this->avatarProviders” being
“AvatarProviderInterface[]” cannot be natively typed in some
cases, and should thus be a help for the IDE but not an exception
in TYPO3’s phpstan baseline.

Reviews 1