CodeIgniter4 icon indicating copy to clipboard operation
CodeIgniter4 copied to clipboard

Dev: PHPStan "no type specified" errors

Open kenjis opened this issue 2 years ago • 6 comments

There are 473 ignored errors due to "no type specified" in phpstan-baseline.php. These ignored errors should be removed.

You can search for no type specified, no return type specified in phpstan-baseline.php.

kenjis avatar Jul 22 '23 08:07 kenjis

Type specified will strict return, most function with multiple return

We can use below in PHP 8.2, is not compabillity another php version

public function isFunction(): string|int {
//
}

We can only change some functions.

ddevsr avatar Jul 24 '23 01:07 ddevsr

Yes, we still support PHP 7.4. In that case, add @return.

kenjis avatar Jul 24 '23 01:07 kenjis

238 items were removed!

473 - 235 = 238

$ grep "type specified" phpstan-baseline.php | wc -l
     235

kenjis avatar Sep 11 '23 23:09 kenjis

$ grep "type specified" phpstan-baseline.php | wc -l
     221

kenjis avatar Oct 18 '23 08:10 kenjis

$ grep "no type specified" phpstan-baseline.php | wc -l
     224
$ grep "no return type specified" phpstan-baseline.php | wc -l
     382

kenjis avatar Apr 09 '24 01:04 kenjis