| @@ -9,8 +9,9 @@ | ||
| 9 | 9 | use Automattic\Jetpack\Connection\Manager as Connection_Manager; |
| 10 | 10 | use Automattic\Jetpack\Connection\Tokens; |
| 11 | 11 | use Automattic\Jetpack\Identity_Crisis; |
| 12 | 12 | use Automattic\Jetpack\IP\Utils as IP_Utils; |
| 13 | +use Automattic\Jetpack\Publicize\Publicize; | |
| 13 | 14 | use Automattic\Jetpack\Status; |
| 14 | 15 | use Automattic\Jetpack\Sync\Actions; |
| 15 | 16 | use Automattic\Jetpack\Sync\Listener; |
| 16 | 17 | use Automattic\Jetpack\Sync\Modules; |
| @@ -21,8 +22,9 @@ | ||
| 21 | 22 | if ( ! class_exists( 'WP_CLI_Command' ) ) { |
| 22 | 23 | return; |
| 23 | 24 | } |
| 24 | 25 | |
| 26 | +// @phan-suppress-next-line PhanUndeclaredFunctionInCallable -- https://github.com/phan/phan/issues/4763 | |
| 25 | 27 | WP_CLI::add_command( 'jetpack', 'Jetpack_CLI' ); |
| 26 | 28 | |
| 27 | 29 | /** |
| 28 | 30 | * Control your local Jetpack installation. |
| @@ -1071,9 +1073,9 @@ | ||
| 1071 | 1073 | WP_CLI::log( __( 'Sent more data to WordPress.com', 'jetpack' ) ); |
| 1072 | 1074 | } |
| 1073 | 1075 | |
| 1074 | 1076 | // Immediate Full Sync does not wait for WP.com to process data so we need to enforce a wait. |
| 1075 | - if ( str_contains( get_class( Modules::get_module( 'full-sync' ) ), 'Full_Sync_Immediately' ) ) { | |
| 1077 | + if ( Modules::get_module( 'full-sync' ) instanceof \Automattic\Jetpack\Sync\Modules\Full_Sync_Immediately ) { | |
| 1076 | 1078 | sleep( 15 ); |
| 1077 | 1079 | } |
| 1078 | 1080 | } |
| 1079 | 1081 | ++$i; |
| @@ -1734,9 +1736,9 @@ | ||
| 1734 | 1736 | |
| 1735 | 1737 | WP_CLI::error( __( 'Jetpack is currently in offline mode, so the Jetpack Social module will not load.', 'jetpack' ) ); |
| 1736 | 1738 | } |
| 1737 | 1739 | |
| 1738 | - if ( ! class_exists( 'Publicize' ) ) { | |
| 1740 | + if ( ! class_exists( Publicize::class ) ) { | |
| 1739 | 1741 | WP_CLI::error( __( 'The Jetpack Social module is not loaded.', 'jetpack' ) ); |
| 1740 | 1742 | } |
| 1741 | 1743 | |
| 1742 | 1744 | $action = $args[0]; |
| @@ -1864,11 +1866,13 @@ | ||
| 1864 | 1866 | ) |
| 1865 | 1867 | ); |
| 1866 | 1868 | } |
| 1867 | 1869 | |
| 1870 | + // @phan-suppress-next-line PhanUndeclaredClassMethod - Class is missing from php-stubs/wp-cli-stubs 🤷 | |
| 1868 | 1871 | $progress->tick(); |
| 1869 | 1872 | } |
| 1870 | 1873 | |
| 1874 | + // @phan-suppress-next-line PhanUndeclaredClassMethod - Class is missing from php-stubs/wp-cli-stubs 🤷 | |
| 1871 | 1875 | $progress->finish(); |
| 1872 | 1876 | |
| 1873 | 1877 | if ( 'all' === $service ) { |
| 1874 | 1878 | WP_CLI::success( __( 'All Jetpack Social connections were successfully disconnected.', 'jetpack' ) ); |
| @@ -1901,8 +1905,9 @@ | ||
| 1901 | 1905 | /** |
| 1902 | 1906 | * Log and exit on a partner provision error. |
| 1903 | 1907 | * |
| 1904 | 1908 | * @param WP_Error $error Error. |
| 1909 | + * @return never | |
| 1905 | 1910 | */ |
| 1906 | 1911 | private function partner_provision_error( $error ) { |
| 1907 | 1912 | WP_CLI::log( |
| 1908 | 1913 | wp_json_encode( |