Skip to content

Commit

Permalink
Minor fixes uncovered by codesniffing
Browse files Browse the repository at this point in the history
  • Loading branch information
dshanske committed Dec 28, 2024
1 parent 367cac2 commit 783c7a4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion includes/class-weather-provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public static function markup_value( $property, $value, $args = array() ) {
'round' => false, // False to round to 2 digits, true to round to integer, a numeric value to round to a specific precision.
);
$args = wp_parse_args( $args, $defaults );
$args['units'] = ( $args['units'] === 'imperial' );
$args['units'] = ( 'imperial' === $args['units'] );
$params = self::get_names( $property, $args['units'] );
if ( ! $params ) {
return '';
Expand Down
2 changes: 1 addition & 1 deletion includes/trait-weather-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public static function weather_condition_codes( $code = null ) {
'626' => __( 'Diamond dust', 'simple-location' ),
/* Atmosphere */
'701' => __( 'mist', 'simple-location' ),
'702' => __( 'Frost', 'simple-locaiton' ),
'702' => __( 'Frost', 'simple-location' ),
'703' => __( 'Icy', 'simple-location' ),
'711' => __( 'Smoke', 'simple-location' ),
'721' => __( 'Haze', 'simple-location' ),
Expand Down
4 changes: 2 additions & 2 deletions includes/weather/class-weather-provider-meteostat.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ public function get_conditions( $time = null ) {
}

$file = trailingslashit( Simple_Location_Plugin::$path ) . 'data/meteostat.json';
if ( ! file_exists( $file ) ) {
if ( ! sloc_file_exists( $file ) ) {
return new WP_Error( 'filesystem_error', "File doesn't exist", wp_json_encode( $file ) );
}
$data = file_get_contents( $file );
$data = sloc_get_contents( $file );
$sitelist = json_decode( $data, true );
foreach ( $sitelist as $key => $value ) {
$sitelist[ $key ]['distance'] = round( geo_distance( $this->latitude, $this->longitude, $value['location']['latitude'], $value['location']['longitude'] ) );
Expand Down
2 changes: 0 additions & 2 deletions simple-location.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,6 @@ public static function kses_clean() {

),
'li' => array(
'class' => array(),
'id' => array(),
'class' => array(),
'id' => array(),
'title' => array(),
Expand Down

0 comments on commit 783c7a4

Please sign in to comment.