Skip to content

Remove incorrect overrides in PHP8 for proc_get_status#429

Merged
ondrejmirtes merged 3 commits intophpstan:masterfrom
Firehed:fix-proc-get-status
Jan 20, 2021
Merged

Remove incorrect overrides in PHP8 for proc_get_status#429
ondrejmirtes merged 3 commits intophpstan:masterfrom
Firehed:fix-proc-get-status

Conversation

@Firehed
Copy link
Copy Markdown
Contributor

@Firehed Firehed commented Jan 20, 2021

Related to #288: the more-precise return shape is overridden with a less-specific version when running under PHP8. This removes the override which seems to have come from an external import.

I'm not sure what's up with the original removal of |false, which doesn't seem to match up with the official docs

@VincentLanglet
Copy link
Copy Markdown
Contributor

The official doc is flag as (PHP 5, PHP 7)

A lot of false value were removed in php 8 https://www.php.net/releases/8.0/en.php#consistent-type-errors-for-internal-functions

@Firehed
Copy link
Copy Markdown
Contributor Author

Firehed commented Jan 20, 2021

Huh, I wasn't under the impression that was a type error which would cause the return false. In that case I'll update this to match override to the more-specific signature. Thanks.

@ondrejmirtes
Copy link
Copy Markdown
Member

Hi, the line could just be removed with the same effect. PHPStan uses official php-src stubs on PHP 8 so it will be inferred from that (and merged with functionMap.php): https://github.com/phpstan/php-8-stubs/blob/main/stubs/ext/standard/proc_get_status.php

@Firehed
Copy link
Copy Markdown
Contributor Author

Firehed commented Jan 20, 2021

Should I roll back to the previous version then? That is what I originally did.

@ondrejmirtes
Copy link
Copy Markdown
Member

Yes, the first commit was sufficient 👍

@ondrejmirtes ondrejmirtes merged commit f69bd3e into phpstan:master Jan 20, 2021
@Firehed Firehed deleted the fix-proc-get-status branch January 20, 2021 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants