codeigniter4/CodeIgniter4

Dev: replace type `mixed` with more specific types

Chiusa

#6310 aperta il 29 lug 2022

 (11 commenti) (0 reazioni) (0 assegnatari)PHP (1707 fork)batch import
devgood first issuehelp wanted

Metriche repository

Star
 (4492 stelle)
Metriche merge PR
 (Merge medio 4g 15h) (68 PR mergiate in 30 g)

Descrizione

Type mixed means object|resource|array|string|int|float|bool|null. https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.mixed

The current code base has a lot of type mixed in PHPDocs, But I think all of them are not correct.

And mixed prevents PHPStan level from increasing.

PHPStan’s rule level 6 isn’t satisfied with implicit mixed https://phpstan.org/writing-php-code/phpdoc-types#mixed

We need to replace type mixed with more specific types.

Guida contributor