Skip to content

Commit

Permalink
Fix phan warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bindlegirl committed Feb 13, 2025
1 parent a38490b commit ecee75d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 8 additions & 1 deletion projects/packages/connection/src/class-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ class Plugin {
*/
private $slug;

/**
* Users Connection Admin instance.
*
* @var Users_Connection_Admin
*/
private $users_connection_admin;

/**
* Initialize the plugin manager.
*
Expand All @@ -41,7 +48,7 @@ public function __construct( $slug ) {

// Always initialize Users_Connection_Admin - it will handle its own conditional loading
if ( is_admin() ) {
new Users_Connection_Admin();
$this->users_connection_admin = new Users_Connection_Admin();
}
}

Expand Down
5 changes: 3 additions & 2 deletions projects/packages/connection/src/sso/class-user-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ public function jetpack_show_connection_status( $val, $col, $user_id ) {
* Creates error notices and redirects the user to the previous page.
*
* @param array $query_params - query parameters added to redirection URL.
* @return string|void The redirect URL or void on failure.
* @return void
*/
public function create_error_notice_and_redirect( $query_params ) {

Check failure on line 1212 in projects/packages/connection/src/sso/class-user-admin.php

View workflow job for this annotation

GitHub Actions / Static analysis

Plugin PhanPluginNeverReturnMethod Method \Automattic\Jetpack\Connection\SSO\User_Admin::create_error_notice_and_redirect() never returns and has a return type of void, but phpdoc type never could be used instead FAQ on Phan issues: pdWQjU-Jb-p2
$ref = wp_get_referer();
Expand All @@ -1219,7 +1219,8 @@ public function create_error_notice_and_redirect( $query_params ) {
$query_params,
$ref
);
return wp_safe_redirect( $url );
wp_safe_redirect( $url );
exit;
}

/**
Expand Down

0 comments on commit ecee75d

Please sign in to comment.