Skip to content

Commit

Permalink
Phan: try using 6.3 stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
kraftbj committed Mar 22, 2024
1 parent 5e890bd commit a469a56
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 31 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dealerdirect/phpcodesniffer-composer-installer": "1.0.0",
"phan/phan": "^5.4",
"php-parallel-lint/php-parallel-lint": "1.3.2",
"php-stubs/wordpress-stubs": "^6.4.3",
"php-stubs/wordpress-stubs": "6.3.0",
"php-stubs/wordpress-tests-stubs": "^6.3",
"php-stubs/wp-cli-stubs": "^2.10",
"sirbrillig/phpcs-changed": "2.11.4",
Expand Down
45 changes: 21 additions & 24 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions projects/plugins/jetpack/changelog/update-phan-stubs-63
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: other
Comment: only adding phan suppression


Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ public function current_screen() {

/**
* Print fonts that are used in global styles or block-level settings.
*
* @todo Remove phan suppression when the WP_Font_Face_Resolver class is available in the minimum WordPress version.
*/
public function print_font_faces() {
$fonts = WP_Font_Face_Resolver::get_fonts_from_theme_json();
$fonts = WP_Font_Face_Resolver::get_fonts_from_theme_json(); // // @phan-suppress-current-line PhanUndeclaredClassMethod
$font_slug_aliases = $this->get_font_slug_aliases();
$fonts_to_print = array();

Expand All @@ -75,7 +77,7 @@ function ( $font_slug ) use ( $font_slug_aliases ) {
}

if ( ! empty( $fonts_to_print ) ) {
wp_print_font_faces( $fonts_to_print );
wp_print_font_faces( $fonts_to_print ); // @phan-suppress-current-line PhanUndeclaredFunction
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ public function revoke_user_invite( $user_id ) {

/**
* Renders invitations errors/success messages in users.php.
*
* @phan-suppress PhanUndeclaredFunction
* @todo When WordPress 6.4 is the minimum version, remove the suppression above and function_exists check.
*/
public function handle_invitation_results() {
$valid_nonce = isset( $_GET['_wpnonce'] ) ? wp_verify_nonce( $_GET['_wpnonce'], 'jetpack-sso-invite-user' ) : false; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- WP core doesn't pre-sanitize nonces either.
Expand Down Expand Up @@ -573,6 +576,9 @@ public function jetpack_user_table_row_actions( $actions, $user_object ) {

/**
* Render the invitation email message.
*
* @phan-suppress PhanUndeclaredFunction
* @todo When WordPress 6.4 is the minimum version, remove the suppression above and function_exists check.
*/
public function render_invitation_email_message() {
if ( ! function_exists( 'wp_admin_notice' ) ) {
Expand Down Expand Up @@ -605,6 +611,9 @@ public function render_invitation_email_message() {

/**
* Render a note that wp.com invites will be automatically revoked.
*
* @phan-suppress PhanUndeclaredFunction
* @todo When WordPress 6.4 is the minimum version, remove the suppression above and function_exists check.
*/
public function render_invitations_notices_for_deleted_users() {
if ( ! function_exists( 'wp_admin_notice' ) ) {
Expand Down Expand Up @@ -679,10 +688,10 @@ public function render_wpcom_invite_checkbox( $type ) {
<span><?php esc_html_e( 'Invite user', 'jetpack' ); ?></span>
</legend>
<label for="invite_user_wpcom">
<input
name="invite_user_wpcom"
type="checkbox"
id="invite_user_wpcom"
<input
name="invite_user_wpcom"
type="checkbox"
id="invite_user_wpcom"
<?php checked( ! class_exists( 'WooCommerce' ) ); ?>
>
<?php esc_html_e( 'Invite user to WordPress.com', 'jetpack' ); ?>
Expand Down

0 comments on commit a469a56

Please sign in to comment.