codeigniter4/CodeIgniter4

Dev: replace type `mixed` with more specific types

Closed

#6,310 opened on Jul 29, 2022

 (11 comments) (0 reactions) (0 assignees)PHP (1,707 forks)batch import
devgood first issuehelp wanted

Repository metrics

Stars
 (4,492 stars)
PR merge metrics
 (Avg merge 4d 15h) (68 merged PRs in 30d)

Description

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.

Contributor guide