Skip to content

Commit

Permalink
Add missing function doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Oct 18, 2024
1 parent 7a40121 commit 2c178ae
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions includes/CLI/Plugin_Check_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -703,23 +703,29 @@ function ( $item ) use ( $warning_severity ) {
return array_merge( $errors, $warnings );
}

private function get_low_severity_errors( $file_results, $error_severity ) {
/**
* Returns low severity errors.
*
* @since 1.3.0
*
* @param array $results Check results.
* @param int $error_severity Error severity level.
* @return array Filtered low severity errors.
*/
private function get_low_severity_errors( $results, $error_severity ) {
$low_severity_errors = array_filter(
$file_results,
$results,
function ( $item ) use ( $error_severity ) {
return ( 'ERROR' === $item['type'] && $item['severity'] < $error_severity );
}
);

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

View check run for this annotation

Codecov / codecov/patch

includes/CLI/Plugin_Check_Command.php#L715-L721

Added lines #L715 - L721 were not covered by tests

$low_severity_errors = array_map(
return array_map(
function ( $item ) {
$item['type'] = 'ERROR_EXTRA';

return $item;
},
$low_severity_errors
);

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

View check run for this annotation

Codecov / codecov/patch

includes/CLI/Plugin_Check_Command.php#L723-L729

Added lines #L723 - L729 were not covered by tests

return $low_severity_errors;
}
}

0 comments on commit 2c178ae

Please sign in to comment.