Skip to content

Commit

Permalink
Simplify and prevent warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Djennez committed May 7, 2024
1 parent 76d8f8f commit f1f0860
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/generators/schema/howto.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ private function add_duration( &$data, $attributes ) {
return;
}

$days = ! \is_numeric( $attributes['days'] ) ? 0 : \intval( $attributes['days'] );
$hours = ! \is_numeric( $attributes['hours'] ) ? 0 : \intval( $attributes['hours'] );
$minutes = ! \is_numeric( $attributes['minutes'] ) ? 0 : \intval( $attributes['minutes'] );
$days = \intval( $attributes['days'] ?? 0 );

Check failure on line 49 in src/generators/schema/howto.php

View workflow job for this annotation

GitHub Actions / Check code style

Operation must be bracketed

Check failure on line 49 in src/generators/schema/howto.php

View workflow job for this annotation

GitHub Actions / Check code style

Operation must be bracketed
$hours = \intval( $attributes['hours'] ?? 0 );

Check failure on line 50 in src/generators/schema/howto.php

View workflow job for this annotation

GitHub Actions / Check code style

Operation must be bracketed

Check failure on line 50 in src/generators/schema/howto.php

View workflow job for this annotation

GitHub Actions / Check code style

Operation must be bracketed
$minutes = \intval( $attributes['minutes'] ?? 0 );

Check failure on line 51 in src/generators/schema/howto.php

View workflow job for this annotation

GitHub Actions / Check code style

Operation must be bracketed

Check failure on line 51 in src/generators/schema/howto.php

View workflow job for this annotation

GitHub Actions / Check code style

Operation must be bracketed

if ( ( $days + $hours + $minutes ) > 0 ) {
$data['totalTime'] = \esc_attr( 'P' . $days . 'DT' . $hours . 'H' . $minutes . 'M' );
Expand Down

0 comments on commit f1f0860

Please sign in to comment.