Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev: PHPStan "no type specified" errors #7731

Open
kenjis opened this issue Jul 22, 2023 · 5 comments
Open

Dev: PHPStan "no type specified" errors #7731

kenjis opened this issue Jul 22, 2023 · 5 comments
Labels
dev good first issue Good for newcomers help wanted More help is needed for the proper resolution of an issue or pull request

Comments

@kenjis
Copy link
Member

kenjis commented Jul 22, 2023

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 kenjis added dev good first issue Good for newcomers labels Jul 22, 2023
@kenjis kenjis changed the title Dev: no type specified Dev: no type specified errors Jul 22, 2023
@ddevsr
Copy link
Collaborator

ddevsr commented Jul 24, 2023

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.

@kenjis
Copy link
Member Author

kenjis commented Jul 24, 2023

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

This was referenced Jul 27, 2023
@kenjis
Copy link
Member Author

kenjis commented Sep 11, 2023

238 items were removed!

473 - 235 = 238

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

@kenjis
Copy link
Member Author

kenjis commented Oct 18, 2023

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

@kenjis kenjis changed the title Dev: no type specified errors Dev: PHPStan "no type specified" errors Apr 9, 2024
@kenjis
Copy link
Member Author

kenjis commented Apr 9, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev good first issue Good for newcomers help wanted More help is needed for the proper resolution of an issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants