Skip to content

Commit

Permalink
fix phplint
Browse files Browse the repository at this point in the history
  • Loading branch information
davidperezgar committed Oct 11, 2024
1 parent 5437ba4 commit a76a7e5
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions includes/CLI/Plugin_Check_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -696,17 +696,17 @@ private function get_filtered_results( $results, $error_severity, $warning_sever
*/
private function get_filtered_results_by_severity( $results, $error_severity, $warning_severity ) {
$errors = array_filter(
$results,
function ( $item ) use ( $error_severity ) {
return ( 'ERROR' === $item['type'] && $item['severity'] >= $error_severity );
}
$results,
function ( $item ) use ( $error_severity ) {
return ( 'ERROR' === $item['type'] && $item['severity'] >= $error_severity );
}
);

$warnings = array_filter(
$results,
function ( $item ) use ( $warning_severity ) {
return ( 'WARNING' === $item['type'] && $item['severity'] >= $warning_severity );
}
$results,
function ( $item ) use ( $warning_severity ) {
return ( 'WARNING' === $item['type'] && $item['severity'] >= $warning_severity );
}
);

return array_merge( $errors, $warnings );
Expand All @@ -720,19 +720,18 @@ function ( $item ) use ( $warning_severity ) {
*/
private function convert_errors_to_warnings( $results, $error_severity ) {
$errors_warning = array_filter(
$results,
function ( $item ) use ( $error_severity ) {
return ( 'ERROR' === $item['type'] && $item['severity'] < $error_severity );
}
$results,
function ( $item ) use ( $error_severity ) {
return ( 'ERROR' === $item['type'] && $item['severity'] < $error_severity );

Check warning on line 725 in includes/CLI/Plugin_Check_Command.php

View check run for this annotation

Codecov / codecov/patch

includes/CLI/Plugin_Check_Command.php#L721-L725

Added lines #L721 - L725 were not covered by tests
}
);

return array_map(
function ( $item ) {
$item['type'] = 'WARNING';
return $item;
},
$errors_warning
function ( $item ) {
$item['type'] = 'WARNING';
return $item;
},
$errors_warning

Check warning on line 734 in includes/CLI/Plugin_Check_Command.php

View check run for this annotation

Codecov / codecov/patch

includes/CLI/Plugin_Check_Command.php#L729-L734

Added lines #L729 - L734 were not covered by tests
);
}

}

0 comments on commit a76a7e5

Please sign in to comment.