Skip to content

Commit

Permalink
phan: Fix more phpdocs (#37042)
Browse files Browse the repository at this point in the history
Another pass through the PhanUndeclared issues looking for issues that
are due to phpdocs being wrong.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8837036730

Upstream-Ref: Automattic/jetpack@f31bc10
  • Loading branch information
anomiex authored and matticbot committed Apr 25, 2024
1 parent 40c6d5d commit 0dee3e4
Show file tree
Hide file tree
Showing 25 changed files with 263 additions and 244 deletions.
6 changes: 3 additions & 3 deletions composer.json
Expand Up @@ -9,10 +9,10 @@
"automattic/jetpack-autoloader": "^3.0.6",
"automattic/jetpack-composer-plugin": "^2.0.1",
"automattic/jetpack-config": "^2.0.1",
"automattic/jetpack-identity-crisis": "^0.18.4",
"automattic/jetpack-my-jetpack": "^4.22.2",
"automattic/jetpack-identity-crisis": "^0.18.5-alpha",
"automattic/jetpack-my-jetpack": "^4.22.3-alpha",
"automattic/jetpack-plugins-installer": "^0.3.4",
"automattic/jetpack-sync": "^2.13.1",
"automattic/jetpack-sync": "^2.13.2-alpha",
"automattic/jetpack-backup": "^3.3.9"
},
"require-dev": {
Expand Down
4 changes: 2 additions & 2 deletions jetpack_vendor/automattic/jetpack-backup/composer.json
Expand Up @@ -12,8 +12,8 @@
"automattic/jetpack-composer-plugin": "^2.0.1",
"automattic/jetpack-config": "^2.0.1",
"automattic/jetpack-connection": "^2.7.4-alpha",
"automattic/jetpack-identity-crisis": "^0.18.4",
"automattic/jetpack-sync": "^2.13.1",
"automattic/jetpack-identity-crisis": "^0.18.5-alpha",
"automattic/jetpack-sync": "^2.13.2-alpha",
"automattic/jetpack-status": "^3.0.0"
},
"require-dev": {
Expand Down
Expand Up @@ -321,9 +321,9 @@ public static function _wp_remote_request( $url, $args, $set_fallback = false )
/**
* Sets the time difference for correct signature computation.
*
* @param array $response Response array from `wp_remote_request`.
* @param bool $force_set whether to force setting the time difference.
* @phan-param _WP_Remote_Response_Array $response
* @param array|WP_Error $response Response array from `wp_remote_request`, or WP_Error on error.
* @param bool $force_set whether to force setting the time difference.
* @phan-param _WP_Remote_Response_Array|WP_Error $response
*/
public static function set_time_diff( &$response, $force_set = false ) {
$code = wp_remote_retrieve_response_code( $response );
Expand Down
Expand Up @@ -16,8 +16,10 @@
use Automattic\Jetpack\Status\Host;
use Automattic\Jetpack\Terms_Of_Service;
use Automattic\Jetpack\Tracking;
use IXR_Error;
use Jetpack_IXR_Client;
use Jetpack_Options;
use Jetpack_XMLRPC_Server;
use WP_Error;
use WP_User;

Expand Down Expand Up @@ -160,16 +162,16 @@ public static function configure() {
*
* @since 1.25.0 Deprecate $is_active param.
*
* @param array $request_params incoming request parameters.
* @param bool $has_connected_owner Whether the site has a connected owner.
* @param bool $is_signed whether the signature check has been successful.
* @param \Jetpack_XMLRPC_Server $xmlrpc_server (optional) an instance of the server to use instead of instantiating a new one.
* @param array $request_params incoming request parameters.
* @param bool $has_connected_owner Whether the site has a connected owner.
* @param bool $is_signed whether the signature check has been successful.
* @param Jetpack_XMLRPC_Server $xmlrpc_server (optional) an instance of the server to use instead of instantiating a new one.
*/
public function setup_xmlrpc_handlers(
$request_params,
$has_connected_owner,
$is_signed,
\Jetpack_XMLRPC_Server $xmlrpc_server = null
Jetpack_XMLRPC_Server $xmlrpc_server = null
) {
add_filter( 'xmlrpc_blog_options', array( $this, 'xmlrpc_options' ), 1000, 2 );

Expand Down Expand Up @@ -204,7 +206,7 @@ public function setup_xmlrpc_handlers(
if ( $xmlrpc_server ) {
$this->xmlrpc_server = $xmlrpc_server;
} else {
$this->xmlrpc_server = new \Jetpack_XMLRPC_Server();
$this->xmlrpc_server = new Jetpack_XMLRPC_Server();
}

$this->require_jetpack_authentication();
Expand Down Expand Up @@ -2321,7 +2323,7 @@ public function public_xmlrpc_methods( $methods ) {
* Handles a getOptions XMLRPC method call.
*
* @param array $args method call arguments.
* @return an amended XMLRPC server options array.
* @return array|IXR_Error An amended XMLRPC server options array.
*/
public function jetpack_get_options( $args ) {
global $wp_xmlrpc_server;
Expand Down
Expand Up @@ -317,7 +317,7 @@ public function verify_registration( WP_REST_Request $request ) {
*
* @param WP_REST_Request $request The request sent to the WP REST API.
*
* @return array|wp-error
* @return array|WP_Error
*/
public static function remote_authorize( $request ) {
$xmlrpc_server = new Jetpack_XMLRPC_Server();
Expand Down
Expand Up @@ -82,8 +82,8 @@ public static function normalize_www_in_url( $option, $url_function ) {
/**
* Return URL with a normalized protocol.
*
* @param callable $callable Function to retrieve URL option.
* @param string $new_value URL Protocol to set URLs to.
* @param string $callable Function name that was used to retrieve URL option.
* @param string $new_value URL Protocol to set URLs to.
* @return string Normalized URL.
*/
public static function get_protocol_normalized_url( $callable, $new_value ) {
Expand Down
Expand Up @@ -7,6 +7,8 @@

namespace Automattic\Jetpack\Connection;

use IXR_Error;

/**
* Registers the XML-RPC methods for Connections.
*/
Expand Down Expand Up @@ -69,10 +71,10 @@ private function output( $data ) {
$code = -10520;
}

if ( ! class_exists( \IXR_Error::class ) ) {
if ( ! class_exists( IXR_Error::class ) ) {
require_once ABSPATH . WPINC . '/class-IXR.php';
}
return new \IXR_Error(
return new IXR_Error(
$code,
sprintf( 'Jetpack: [%s] %s', $data->get_error_code(), $data->get_error_message() )
);
Expand Down
Expand Up @@ -21,7 +21,7 @@ class Authorize_Redirect {
/**
* The Connection Manager object.
*
* @var Manager
* @var \Automattic\Jetpack\Connection\Manager
*/
private $connection;

Expand Down
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.18.5-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

## [0.18.4] - 2024-04-25
### Changed
- Update dependencies.
Expand Down Expand Up @@ -536,6 +540,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated package dependencies.
- Use Connection/Urls for home_url and site_url functions migrated from Sync.

[0.18.5-alpha]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.18.4...v0.18.5-alpha
[0.18.4]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.18.3...v0.18.4
[0.18.3]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.18.2...v0.18.3
[0.18.2]: https://github.com/Automattic/jetpack-identity-crisis/compare/v0.18.1...v0.18.2
Expand Down
Expand Up @@ -26,7 +26,7 @@ class Identity_Crisis {
/**
* Package Version
*/
const PACKAGE_VERSION = '0.18.4';
const PACKAGE_VERSION = '0.18.5-alpha';

/**
* Package Slug
Expand Down
5 changes: 5 additions & 0 deletions jetpack_vendor/automattic/jetpack-my-jetpack/CHANGELOG.md
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.22.3-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

## [4.22.2] - 2024-04-25
### Fixed
- My Jetpack: Fix issue where the TOS component was being called inside of a <p>, throwing a warning that <p> can't be a descendant of <p>. This also fixes the font size of the TOS text. [#37034]
Expand Down Expand Up @@ -1441,6 +1445,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Created package

[4.22.3-alpha]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.22.2...4.22.3-alpha
[4.22.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.22.1...4.22.2
[4.22.1]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.22.0...4.22.1
[4.22.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/4.21.0...4.22.0
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-my-jetpack/composer.json
Expand Up @@ -21,7 +21,7 @@
"yoast/phpunit-polyfills": "1.1.0",
"automattic/jetpack-changelogger": "^4.2.2",
"automattic/wordbless": "@dev",
"automattic/jetpack-videopress": "^0.23.17"
"automattic/jetpack-videopress": "^0.23.18-alpha"
},
"suggest": {
"automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package."
Expand Down
Expand Up @@ -37,7 +37,7 @@ class Initializer {
*
* @var string
*/
const PACKAGE_VERSION = '4.22.2';
const PACKAGE_VERSION = '4.22.3-alpha';

/**
* HTML container ID for the IDC screen on My Jetpack page.
Expand All @@ -62,7 +62,7 @@ class Initializer {
/**
* Holds info/data about the site (from the /sites/%d endpoint)
*
* @var stdClass Object
* @var object
*/
public static $site_info;

Expand Down Expand Up @@ -509,7 +509,7 @@ public static function get_site() {
/**
* Populates the self::$site_info var with site data from the /sites/%d endpoint
*
* @return Object|WP_Error
* @return object|WP_Error
*/
public static function get_site_info() {
static $site_info = null;
Expand Down
5 changes: 5 additions & 0 deletions jetpack_vendor/automattic/jetpack-sync/CHANGELOG.md
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.13.2-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

## [2.13.1] - 2024-04-25
### Changed
- Update dependencies.
Expand Down Expand Up @@ -1112,6 +1116,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Packages: Move sync to a classmapped package

[2.13.2-alpha]: https://github.com/Automattic/jetpack-sync/compare/v2.13.1...v2.13.2-alpha
[2.13.1]: https://github.com/Automattic/jetpack-sync/compare/v2.13.0...v2.13.1
[2.13.0]: https://github.com/Automattic/jetpack-sync/compare/v2.12.0...v2.13.0
[2.12.0]: https://github.com/Automattic/jetpack-sync/compare/v2.11.1...v2.12.0
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-sync/composer.json
Expand Up @@ -7,7 +7,7 @@
"php": ">=7.0",
"automattic/jetpack-connection": "^2.7.4-alpha",
"automattic/jetpack-constants": "^2.0.1",
"automattic/jetpack-identity-crisis": "^0.18.4",
"automattic/jetpack-identity-crisis": "^0.18.5-alpha",
"automattic/jetpack-password-checker": "^0.3.1",
"automattic/jetpack-ip": "^0.2.2",
"automattic/jetpack-roles": "^2.0.2",
Expand Down
Expand Up @@ -402,8 +402,8 @@ public static function main_network_site_wpcom_id() {
*
* @deprecated 1.23.1
*
* @param callable $callable Function to retrieve URL option.
* @param string $new_value URL Protocol to set URLs to.
* @param string $callable Function name that was used to retrieve URL option.
* @param string $new_value URL Protocol to set URLs to.
* @return string Normalized URL.
*/
public static function get_protocol_normalized_url( $callable, $new_value ) {
Expand Down Expand Up @@ -596,8 +596,8 @@ public static function get_is_fse_theme() {
*
* @since 1.21.0
*
* @param array|obj $any Source data to be cleaned up.
* @param array $seen_nodes Built array of nodes.
* @param mixed $any Source data to be cleaned up.
* @param array $seen_nodes Built array of nodes.
*
* @return array
*/
Expand Down
Expand Up @@ -52,7 +52,7 @@ public function decode( $input ) {
*
* @see https://gist.github.com/muhqu/820694
*
* @param string $any Value to serialize and wrap.
* @param mixed $any Value to serialize and wrap.
*
* @return false|string
*/
Expand Down
Expand Up @@ -12,7 +12,7 @@
*/
class Package_Version {

const PACKAGE_VERSION = '2.13.1';
const PACKAGE_VERSION = '2.13.2-alpha';

const PACKAGE_SLUG = 'sync';

Expand Down
Expand Up @@ -702,7 +702,7 @@ public function do_sync_for_queue( $queue ) {
* @param string $action_name The action.
* @param array $data The data associated with the action.
*
* @return Items processed. TODO: this doesn't make much sense anymore, it should probably be just a bool.
* @return array Items processed. TODO: this doesn't make much sense anymore, it should probably be just a bool.
*/
public function send_action( $action_name, $data = null ) {
if ( ! Settings::is_sender_enabled( 'full_sync' ) ) {
Expand Down
Expand Up @@ -242,7 +242,7 @@ public function add_all( $items, $id_prefix ) {
*
* @param int $max_count How many items to fetch from the queue.
*
* @return \stdClass[]|null
* @return object[]|null
*/
public function get_items_ids_with_size( $max_count ) {
global $wpdb;
Expand Down
Expand Up @@ -222,7 +222,7 @@ public function insert_item( $item_id, $item ) {
* @param int|null $item_count How many items to fetch from the queue.
* The parameter is null-able, if no limit on the amount of items.
*
* @return array|object|stdClass[]|null
* @return object[]|null
*/
public function fetch_items( $item_count ) {
global $wpdb;
Expand Down Expand Up @@ -278,7 +278,7 @@ public function fetch_items( $item_count ) {
*
* @param array $items_ids Items IDs to fetch from the queue.
*
* @return array|object|stdClass[]|null
* @return object[]|null
*/
public function fetch_items_by_ids( $items_ids ) {
global $wpdb;
Expand Down Expand Up @@ -432,7 +432,7 @@ public function add_all( $items, $id_prefix ) {
*
* @param int $max_count How many items to fetch from the queue.
*
* @return array|object|stdClass[]|null
* @return object[]|null
*/
public function get_items_ids_with_size( $max_count ) {
global $wpdb;
Expand Down
8 changes: 4 additions & 4 deletions jetpack_vendor/i18n-map.php
Expand Up @@ -30,11 +30,11 @@
),
'jetpack-connection' => array(
'path' => 'jetpack_vendor/automattic/jetpack-connection',
'ver' => '2.7.4-alpha1714062343',
'ver' => '2.7.4-alpha1714066953',
),
'jetpack-idc' => array(
'path' => 'jetpack_vendor/automattic/jetpack-identity-crisis',
'ver' => '0.18.4',
'ver' => '0.18.5-alpha1714066953',
),
'jetpack-ip' => array(
'path' => 'jetpack_vendor/automattic/jetpack-ip',
Expand All @@ -50,7 +50,7 @@
),
'jetpack-my-jetpack' => array(
'path' => 'jetpack_vendor/automattic/jetpack-my-jetpack',
'ver' => '4.22.2',
'ver' => '4.22.3-alpha1714066953',
),
'jetpack-password-checker' => array(
'path' => 'jetpack_vendor/automattic/jetpack-password-checker',
Expand All @@ -62,7 +62,7 @@
),
'jetpack-sync' => array(
'path' => 'jetpack_vendor/automattic/jetpack-sync',
'ver' => '2.13.1',
'ver' => '2.13.2-alpha1714066953',
),
),
);

0 comments on commit 0dee3e4

Please sign in to comment.