Skip to content

Commit

Permalink
Additional phpcs recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
dshanske committed Jan 6, 2025
1 parent 2fed9e4 commit 6593b61
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
# Check the code-style consistency of the PHP files.
- name: Check PHP code style
id: phpcs
run: composer lint:wpcs -- --no-cache --report-full --report-checkstyle=./phpcs-report.xml
run: composer lint:wpcs -- --config-set ignore_warnings_on_exit 1 --no-cache --report-full --report-checkstyle=./phpcs-report.xml
- name: Show PHPCS results in PR
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
run: cs2pr ./phpcs-report.xml
Expand Down
1 change: 1 addition & 0 deletions includes/class-location-provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ public function get_activity_list() {
}

/**
* Converts knots to meters.
*
* @param float $knots Knots.
* @return float $meters Meters.
Expand Down
2 changes: 1 addition & 1 deletion includes/trait-geolocation-trait.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

/**
*
* GeoLocation Trait.
*
* @since 5.0.0
*/
Expand Down
10 changes: 5 additions & 5 deletions includes/widgets/class-sloc-weather-widget.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* adds widget to display weather with per-user profile support
* Adds widget to display weather with per-user profile support
*/
class Sloc_Weather_Widget extends WP_Widget {

/**
* widget constructor
* Widget constructor
*/
public function __construct() {
parent::__construct(
Expand All @@ -20,7 +20,7 @@ public function __construct() {
}

/**
* widget worker
* Widget worker
*
* @param mixed $args widget parameters
* @param mixed $instance saved widget data
Expand Down Expand Up @@ -51,7 +51,7 @@ public function widget( $args, $instance ) {
}

if ( is_wp_error( $weather ) ) {
echo $weather->get_error_message();
echo esc_html( $weather->get_error_message() );
} elseif ( is_array( $weather ) ) {
echo wp_kses( self::weather_list( $weather, 'fa-map', $instance ), Simple_Location_Plugin::kses_clean() );
} elseif ( is_string( $weather ) ) {
Expand Down Expand Up @@ -111,7 +111,7 @@ protected static function weather_list( $weather, $icon = 'fa-map', $instance =
}

if ( isset( $weather['_expires_at'] ) ) {
$return[] = printf( '<!-- %1$s: %2$s -->', __( 'Current Conditions Cache Expires At', 'simple-location' ), $weather['_expires_at'] );
$return[] = printf( '<!-- %1$s: %2$s -->', esc_html__( 'Current Conditions Cache Expires At', 'simple-location' ), esc_html( $weather['_expires_at'] ) );
}

if ( isset( $instance['showastro'] ) && 1 === (int) $instance['showastro'] && array_key_exists( 'latitude', $weather ) && array_key_exists( 'longitude', $weather ) ) {
Expand Down

0 comments on commit 6593b61

Please sign in to comment.