Skip to content

Commit

Permalink
Update/connection annotations (#20766)
Browse files Browse the repository at this point in the history
* Change @SInCE annotations

* Update @deprecated annotations
  • Loading branch information
leogermani authored Aug 21, 2021
1 parent acd20c8 commit 4ae507f
Show file tree
Hide file tree
Showing 17 changed files with 204 additions and 157 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

update annotations versions
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
*
* @package automattic/jetpack-connection
*
* @since 1.5
* @since 7.7 Moved to the jetpack-connection package.
* @since 1.7.0
* @since-jetpack 1.5
* @since-jetpack 7.7 Moved to the jetpack-connection package.
*/

use Automattic\Jetpack\Connection\Client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
*
* @package automattic/jetpack-connection
*
* @since 1.5
* @since 7.7 Moved to the jetpack-connection package.
* @since 1.7.0
* @since-jetpack 1.5
* @since-jetpack 7.7 Moved to the jetpack-connection package.
*/

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ private function join_array_with_equal_sign( $name, $value ) {
* It will analyze the current request, as well as some Jetpack constants, to return the string
* to be concatenated in the URL representing the port of the current request.
*
* @since 9.2.0
* @since 1.8.4
*
* @return string The port to be used in the signature
*/
Expand Down Expand Up @@ -382,7 +382,7 @@ public function get_current_request_port() {
/**
* Sanitizes a variable checking if it's a valid port number, which can be an integer or a numeric string
*
* @since 9.2.0
* @since 1.8.4
*
* @param mixed $port_number Variable representing a port number.
* @return string Always a string with a valid port number, or an empty string if input is invalid
Expand Down
38 changes: 21 additions & 17 deletions projects/packages/connection/legacy/class-jetpack-xmlrpc-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ public function xmlrpc_methods( $core_methods ) {
/**
* Filters the XML-RPC methods available to Jetpack for authenticated users.
*
* @since 1.1.0
* @since 1.7.0
* @since-jetpack 1.1.0
*
* @param array $jetpack_methods XML-RPC methods available to the Jetpack Server.
* @param array $core_methods Available core XML-RPC methods.
Expand All @@ -92,8 +93,9 @@ public function xmlrpc_methods( $core_methods ) {
/**
* Filters the XML-RPC methods available to Jetpack for requests signed both with a blog token or a user token.
*
* @since 3.0.0
* @since 9.6.0 Introduced the $user parameter.
* @since 1.7.0
* @since 1.9.5 Introduced the $user parameter.
* @since-jetpack 3.0.0
*
* @param array $jetpack_methods XML-RPC methods available to the Jetpack Server.
* @param array $core_methods Available core XML-RPC methods.
Expand Down Expand Up @@ -213,7 +215,8 @@ public function remote_authorize( $request ) {
* - remote_provision
* - get_user.
*
* @since 8.0.0
* @since 1.7.0
* @since-jetpack 8.0.0
*
* @param String $action the action name, i.e., 'remote_authorize'.
* @param String $stage the execution stage, can be 'begin', 'success', 'error', etc.
Expand Down Expand Up @@ -380,7 +383,7 @@ public function remote_provision( $request ) {
*
* @param string $redirect_uri The Redirect URI
*
* @since 9.8.0
* @since 1.9.7
*/
$redirect_uri = apply_filters( 'jetpack_xmlrpc_remote_register_redirect_uri', admin_url() );

Expand Down Expand Up @@ -411,7 +414,7 @@ public function remote_provision( $request ) {
* @param array $request An array containing at minimum a nonce key and a local_username key.
* @param \WP_User $user The local authenticated user.
*
* @since 9.8.0
* @since 1.9.7
*/
$response = apply_filters( 'jetpack_remote_xmlrpc_provision_response', $response, $request, $user );

Expand Down Expand Up @@ -492,7 +495,7 @@ public function remote_connect( $request, $ixr_client = false ) {
/**
* Hook fired at the end of the jetpack.remoteConnect XML-RPC callback
*
* @since 9.8.0
* @since 1.9.7
*/
do_action( 'jetpack_remote_connect_end' );

Expand Down Expand Up @@ -727,7 +730,8 @@ public function unlink_user( $user_id = array() ) {
/**
* Fired when we want to log an event to the Jetpack event log.
*
* @since 7.7.0
* @since 1.7.0
* @since-jetpack 7.7.0
*
* @param string $code Unique name for the event.
* @param string $data Optional data about the event.
Expand All @@ -742,7 +746,7 @@ public function unlink_user( $user_id = array() ) {
/**
* Returns any object that is able to be synced.
*
* @deprecated since 7.8.0
* @deprecated since jetpack 7.8.0
* @see Automattic\Jetpack\Sync\Sender::sync_object()
*
* @param array $args the synchronized object parameters.
Expand Down Expand Up @@ -789,13 +793,13 @@ public function update_attachment_parent( $args ) {
*
* Disconnect this blog from the connected wordpress.com account
*
* @deprecated since 9.6.0
* @deprecated since 1.25.0
* @see Jetpack_XMLRPC_Methods::disconnect_blog() in the Jetpack plugin
*
* @return boolean
*/
public function disconnect_blog() {
_deprecated_function( __METHOD__, 'jetpack-9.6', 'Jetpack_XMLRPC_Methods::disconnect_blog()' );
_deprecated_function( __METHOD__, '1.25.0', 'Jetpack_XMLRPC_Methods::disconnect_blog()' );
if ( class_exists( 'Jetpack_XMLRPC_Methods' ) ) {
return Jetpack_XMLRPC_Methods::disconnect_blog();
}
Expand All @@ -807,13 +811,13 @@ public function disconnect_blog() {
*
* Returns what features are available. Uses the slug of the module files.
*
* @deprecated since 9.6.0
* @deprecated since 1.25.0
* @see Jetpack_XMLRPC_Methods::features_available() in the Jetpack plugin
*
* @return array
*/
public function features_available() {
_deprecated_function( __METHOD__, 'jetpack-9.6', 'Jetpack_XMLRPC_Methods::features_available()' );
_deprecated_function( __METHOD__, '1.25.0', 'Jetpack_XMLRPC_Methods::features_available()' );
if ( class_exists( 'Jetpack_XMLRPC_Methods' ) ) {
return Jetpack_XMLRPC_Methods::features_available();
}
Expand All @@ -825,13 +829,13 @@ public function features_available() {
*
* Returns what features are enabled. Uses the slug of the modules files.
*
* @deprecated since 9.6.0
* @deprecated since 1.25.0
* @see Jetpack_XMLRPC_Methods::features_enabled() in the Jetpack plugin
*
* @return array
*/
public function features_enabled() {
_deprecated_function( __METHOD__, 'jetpack-9.6', 'Jetpack_XMLRPC_Methods::features_enabled()' );
_deprecated_function( __METHOD__, '1.25.0', 'Jetpack_XMLRPC_Methods::features_enabled()' );
if ( class_exists( 'Jetpack_XMLRPC_Methods' ) ) {
return Jetpack_XMLRPC_Methods::features_enabled();
}
Expand All @@ -843,13 +847,13 @@ public function features_enabled() {
*
* Serve a JSON API request.
*
* @deprecated since 9.6.0
* @deprecated since 1.25.0
* @see Jetpack_XMLRPC_Methods::json_api() in the Jetpack plugin
*
* @param array $args request arguments.
*/
public function json_api( $args = array() ) {
_deprecated_function( __METHOD__, 'jetpack-9.6', 'Jetpack_XMLRPC_Methods::json_api()' );
_deprecated_function( __METHOD__, '1.25.0', 'Jetpack_XMLRPC_Methods::json_api()' );
if ( class_exists( 'Jetpack_XMLRPC_Methods' ) ) {
return Jetpack_XMLRPC_Methods::json_api( $args );
}
Expand Down
3 changes: 2 additions & 1 deletion projects/packages/connection/legacy/load-ixr.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* Here we ensure that they are loaded before we declare our implementations.
*
* @package automattic/jetpack-connection
* @since 7.7
* @since 1.7.0
* @since-jetpack 7.7.0
*/

if ( defined( 'ABSPATH' ) && defined( 'WPINC' ) ) {
Expand Down
7 changes: 4 additions & 3 deletions projects/packages/connection/src/class-client.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ public static function _wp_remote_request( $url, $args, $set_fallback = false )
* Return `true` to ENABLE SSL verification, return `false`
* to DISABLE SSL verification.
*
* @since 3.6.0
* @since 1.7.0
* @since-jetpack 3.6.0
*
* @param bool Whether to force `sslverify` or not.
*/
Expand Down Expand Up @@ -467,10 +468,10 @@ public static function _stringify_data( $data ) { // phpcs:ignore PSR2.Methods.M
*
* @return string Always 'https'.
*
* @deprecated 9.1.0 WP.com API no longer supports requests using `http://`.
* @deprecated 1.19.2 WP.com API no longer supports requests using `http://`.
*/
public static function protocol() {
_deprecated_function( __METHOD__, 'jetpack-9.1.0' );
_deprecated_function( __METHOD__, '1.19.2' );

return 'https';
}
Expand Down
Loading

0 comments on commit 4ae507f

Please sign in to comment.