Skip to content

Commit

Permalink
Update condition for detecting missing headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Feb 7, 2024
1 parent 71fcdb0 commit e5ca523
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion includes/Checker/Checks/Plugin_Readme_Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ private function check_headers( Check_Result $result, string $readme_file, Parse
),
);

Check warning on line 147 in includes/Checker/Checks/Plugin_Readme_Check.php

View check run for this annotation

Codecov / codecov/patch

includes/Checker/Checks/Plugin_Readme_Check.php#L138-L147

Added lines #L138 - L147 were not covered by tests

$parser_warnings = $parser->warnings ?? array();

Check failure on line 149 in includes/Checker/Checks/Plugin_Readme_Check.php

View workflow job for this annotation

GitHub Actions / PHP

Property WordPressdotorg\Plugin_Directory\Readme\Parser::$warnings (array) on left side of ?? is not nullable.

Check warning on line 149 in includes/Checker/Checks/Plugin_Readme_Check.php

View check run for this annotation

Codecov / codecov/patch

includes/Checker/Checks/Plugin_Readme_Check.php#L149

Added line #L149 was not covered by tests

foreach ( $fields as $field_key => $field ) {
if ( empty( $parser->{$field_key} ) && ! in_array( $field['ignore_key'], $ignored_warnings, true ) ) {
if ( empty( $parser->{$field_key} ) && ! in_array( $field['ignore_key'], $ignored_warnings, true ) && ! isset( $parser_warnings[ $field['ignore_key'] ] ) ) {
$this->add_result_warning_for_file(
$result,
sprintf(

Check warning on line 155 in includes/Checker/Checks/Plugin_Readme_Check.php

View check run for this annotation

Codecov / codecov/patch

includes/Checker/Checks/Plugin_Readme_Check.php#L151-L155

Added lines #L151 - L155 were not covered by tests
Expand Down

0 comments on commit e5ca523

Please sign in to comment.