Bump PHPStan to level 5 and fix type/annotation issues#1213
Merged
Conversation
gabriel-detassigny
approved these changes
Jul 24, 2026
gabrielcld2
approved these changes
Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Approach
phpstan.neon.dist.argument.typeerrors, which were all type mismatches at call sites:uniqid,esc_attr,gmdate,md5,substr,array_chunk,number_format_i18n,_n,filter_inputresults, andnew Relationship.null/falsewitharray()forwp_register_script/wp_register_style/wp_enqueue_script$depsandComponent::build_tag$attributes.delete_metadatanullobject id changed to0(the WP delete-all pattern).Media::cloudinary_url($size/$transformations),Media::update_post_meta($data→mixed),Api::upload/Api::url,Lock_File$fileparams,Component::get_part, andSync_Queue::add_to_thread_queue.Connect::validate_domainreturn type (bool→string|false),Delivery::set_usabilityfilter docblocks (object→array), andSyncfilter (WP_Post→\WP_Post|null).Admin::rest_save_settingsfilter closure now returnsbool; added local@var Settings_Component[]inPlugin::setup_settings.QA notes
vendor/bin/phpstan analyse --memory-limit=2G— should report No errors at level 5.composer lint) on the changed files — should pass with no PHPCS violations.