From 9d2f4d8784925a3125ffab047e4dac5c56eb31de Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Thu, 28 Oct 2021 20:01:09 -0500 Subject: [PATCH 1/2] PHPCS updates --- .../plugins/jetpack/src/class-tracking.php | 48 +++++++++++++------ 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/projects/plugins/jetpack/src/class-tracking.php b/projects/plugins/jetpack/src/class-tracking.php index 84db4b84fd894..12b00e415fce6 100644 --- a/projects/plugins/jetpack/src/class-tracking.php +++ b/projects/plugins/jetpack/src/class-tracking.php @@ -1,9 +1,18 @@ initalized ) { return; @@ -101,7 +113,7 @@ public function jetpack_user_authorized() { * * @access public * - * @param string $action Type of secret (one of 'register', 'authorize', 'publicize'). + * @param string $action Type of secret (one of 'register', 'authorize', 'publicize'). * @param \WP_User $user The user object. */ public function jetpack_verify_secrets_begin( $action, $user ) { @@ -113,7 +125,7 @@ public function jetpack_verify_secrets_begin( $action, $user ) { * * @access public * - * @param string $action Type of secret (one of 'register', 'authorize', 'publicize'). + * @param string $action Type of secret (one of 'register', 'authorize', 'publicize'). * @param \WP_User $user The user object. */ public function jetpack_verify_secrets_success( $action, $user ) { @@ -125,8 +137,8 @@ public function jetpack_verify_secrets_success( $action, $user ) { * * @access public * - * @param string $action Type of secret (one of 'register', 'authorize', 'publicize'). - * @param \WP_User $user The user object. + * @param string $action Type of secret (one of 'register', 'authorize', 'publicize'). + * @param \WP_User $user The user object. * @param \WP_Error $error Error object. */ public function jetpack_verify_secrets_fail( $action, $user, $error ) { @@ -166,11 +178,14 @@ public function wp_login_failed( $login ) { * @param string|int $error The error code. * @param \WP_Error $registered The error object. */ - function jetpack_connection_register_fail( $error, $registered ) { - $this->tracking->record_user_event( 'jpc_register_fail', array( - 'error_code' => $error, - 'error_message' => $registered->get_error_message() - ) ); + public function jetpack_connection_register_fail( $error, $registered ) { + $this->tracking->record_user_event( + 'jpc_register_fail', + array( + 'error_code' => $error, + 'error_message' => $registered->get_error_message(), + ) + ); } /** @@ -180,10 +195,13 @@ function jetpack_connection_register_fail( $error, $registered ) { * * @param string $from The 'from' GET parameter. */ - function jetpack_connection_register_success( $from ) { - $this->tracking->record_user_event( 'jpc_register_success', array( - 'from' => $from - ) ); + public function jetpack_connection_register_success( $from ) { + $this->tracking->record_user_event( + 'jpc_register_success', + array( + 'from' => $from, + ) + ); } /** @@ -217,7 +235,7 @@ public function jetpack_xmlrpc_server_event( $action, $stage, $parameters = arra * * @access public */ - function jetpack_verify_api_authorization_request_error_double_encode() { + public function jetpack_verify_api_authorization_request_error_double_encode() { $this->tracking->record_user_event( 'error_double_encode' ); } } From d85205ea40af4717fd072d4a420157254a1f0ee9 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Thu, 28 Oct 2021 20:02:05 -0500 Subject: [PATCH 2/2] Meta: changelog and remove entry from phpcs-excludelist --- projects/plugins/jetpack/changelog/phpcs-srctracking | 5 +++++ tools/phpcs-excludelist.json | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 projects/plugins/jetpack/changelog/phpcs-srctracking diff --git a/projects/plugins/jetpack/changelog/phpcs-srctracking b/projects/plugins/jetpack/changelog/phpcs-srctracking new file mode 100644 index 0000000000000..ac28caa608c9e --- /dev/null +++ b/projects/plugins/jetpack/changelog/phpcs-srctracking @@ -0,0 +1,5 @@ +Significance: patch +Type: other +Comment: PHPCS + + diff --git a/tools/phpcs-excludelist.json b/tools/phpcs-excludelist.json index bef3513fd3f11..ef50fbab076b6 100644 --- a/tools/phpcs-excludelist.json +++ b/tools/phpcs-excludelist.json @@ -397,7 +397,6 @@ "projects/plugins/jetpack/sal/class.json-api-site-jetpack-base.php", "projects/plugins/jetpack/sal/class.json-api-site-jetpack.php", "projects/plugins/jetpack/sal/class.json-api-token.php", - "projects/plugins/jetpack/src/class-tracking.php", "projects/plugins/jetpack/tests/php/_inc/lib/test_class.rest-api-authentication.php", "projects/plugins/jetpack/tests/php/_inc/lib/test_class.rest-api-endpoints.php", "projects/plugins/jetpack/tests/php/attachment_test_case.php",