Closed szepeviktor closed 5 days ago
Many of those can probably be easily fixed in core. cc @johnbillion
I don't fully understand. You're scanning the stubs file in the extension repo? Or should this go to the stubs repo? Why even scanning them with PHPStan? π
Why even scanning them with PHPStan? π
Please see the results!
π
Can we have a list of those errors to check off the ones we won't address and those we have addressed once a fix is merged?
Can we have a list of those errors
a PHPStan baseline file??
Something like this
But I think the baseline approach might be an interesting idea to look into. Maybe with a dedicated phpstan config just for stub checks as you have it here?
I think this is best addressed in WordPress core. A few of these have been reported already across a few tickets. See https://core.trac.wordpress.org/search?ticket=on&q=phpstan .
To please Ian
Someone has smuggled in an array shape for WP_Translation_Controller::translate_plural()
. Unfortunately, the shape is accompanied by the WordPress @type
notation. https://github.com/WordPress/WordPress/blob/9702c2e265bd3aff0522f55063d97ca21cc70099/wp-includes/l10n/class-wp-translation-controller.php#L285-L290
I guess this should be fixed in core as well.
@swissspidy Could you evaluate this? Someone === Pascal
? π
Sure! WP_Translation_Controller::translate_plural
is fixed in https://core.trac.wordpress.org/changeset/58155
Whatβs left to be done here? Anything weβd need to fix in core? :)
Nothing.
Please help!
many errors
``` 530 Property WP_Upgrader::$result (array{source: string, source_files: string, destination: string, destination_name: string, local_destination: string, remote_destination: string, clear_destination: bool}|WP_Error) does not accept default value of type array{}. π‘ Array does not have offset 'source'. 963 Default value of the parameter #1 $admin_header_callback ('') of method Custom_Background::__construct() is incompatible with type callable(): mixed. 963 Default value of the parameter #2 $admin_image_div_callback ('') of method Custom_Background::__construct() is incompatible with type callable(): mixed. 1094 Default value of the parameter #2 $admin_image_div_callback ('') of method Custom_Image_Header::__construct() is incompatible with type callable(): mixed. 1541 Constant FTP_AUTOASCII not found. 1889 PHPDoc type array|WP_Error of property Language_Pack_Upgrader::$result is not covariant with PHPDoc type array{source: string, source_files: string, destination: string, destination_name: string, local_destination: string, remote_destination: string, clear_destination: bool}|WP_Error of overridden property WP_Upgrader::$result. 2946 PHPDoc type array|WP_Error of property Plugin_Upgrader::$result is not covariant with PHPDoc type array{source: string, source_files: string, destination: string, destination_name: string, local_destination: string, remote_destination: string, clear_destination: bool}|WP_Error of overridden property WP_Upgrader::$result. 3265 PHPDoc type array|WP_Error of property Theme_Upgrader::$result is not covariant with PHPDoc type array{source: string, source_files: string, destination: string, destination_name: string, local_destination: string, remote_destination: string, clear_destination: bool}|WP_Error of overridden property WP_Upgrader::$result. 3823 Property Walker_Nav_Menu::$tree_type (string) does not accept default value of type arrayStrange things like docblock for
translate_plural
andWP_REST_Request::offsetExists
.Config for generating these errors.