mirror of
https://github.com/10h30/wp-strava.git
synced 2026-06-05 15:10:01 +09:00
Ignore specific phpcs warnings
This commit is contained in:
+3
-3
@@ -103,10 +103,10 @@ class Polyline {
|
||||
*/
|
||||
final public static function decode( $string ) {
|
||||
$points = array();
|
||||
$index = $i = 0;
|
||||
$index = $i = 0; // phpcs:ignore Squiz.PHP.DisallowMultipleAssignments.Found
|
||||
$previous = array( 0, 0 );
|
||||
while ( $i < strlen( $string ) ) {
|
||||
$shift = $result = 0x00;
|
||||
while ( $i < strlen( $string ) ) { // phpcs:ignore Squiz.PHP.DisallowSizeFunctionsInLoops.Found
|
||||
$shift = $result = 0x00; // phpcs:ignore Squiz.PHP.DisallowMultipleAssignments.Found
|
||||
do {
|
||||
$bit = ord( substr( $string, $i++ ) ) - 63;
|
||||
$result |= ( $bit & 0x1f ) << $shift;
|
||||
|
||||
@@ -30,7 +30,7 @@ class WPStrava_API {
|
||||
return $response;
|
||||
}
|
||||
|
||||
if ( 200 != $response['response']['code'] ) {
|
||||
if ( 200 != $response['response']['code'] ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
|
||||
|
||||
// See if there's useful info in the body.
|
||||
$body = json_decode( $response['body'] );
|
||||
@@ -74,14 +74,14 @@ class WPStrava_API {
|
||||
return $response;
|
||||
}
|
||||
|
||||
if ( 200 != $response['response']['code'] ) {
|
||||
if ( 200 != $response['response']['code'] ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
|
||||
|
||||
// See if there's useful info in the body.
|
||||
$body = json_decode( $response['body'] );
|
||||
$error = '';
|
||||
if ( ! empty( $body->error ) ) {
|
||||
$error = $body->error;
|
||||
} elseif ( 503 == $response['response']['code'] ) {
|
||||
} elseif ( 503 == $response['response']['code'] ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
|
||||
$error = __( 'Strava Temporarily Unavailable', 'wp-strava' );
|
||||
} else {
|
||||
$error = print_r( $response, true ); // phpcs:ignore -- Debug output.
|
||||
|
||||
@@ -115,13 +115,13 @@ class WPStrava_LatestMapWidget extends WP_Widget {
|
||||
|
||||
// Compare transient (temporary storage) to option (more permenant).
|
||||
// If the option isn't set or the transient is different, update the option.
|
||||
if ( empty( $activity_option->id ) || $activity->id != $activity_option->id ) {
|
||||
if ( empty( $activity_option->id ) || $activity->id != $activity_option->id ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
|
||||
$build_new = true;
|
||||
$this->update_activity( $id, $activity );
|
||||
}
|
||||
|
||||
// Update the transient if it needs updating.
|
||||
if ( empty( $activity_transient->id ) || $activity->id != $activity_transient->id ) {
|
||||
if ( empty( $activity_transient->id ) || $activity->id != $activity_transient->id ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
|
||||
$this->update_activity_transient( $id, $activity );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user