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 e2a70be commit ecc4a54
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 @@ -145,8 +145,10 @@ private function check_headers( Check_Result $result, string $readme_file, Parse
),
);

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

View check run for this annotation

Codecov / codecov/patch

includes/Checker/Checks/Plugin_Readme_Check.php#L137-L146

Added lines #L137 - L146 were not covered by tests

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

Check failure on line 148 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 148 in includes/Checker/Checks/Plugin_Readme_Check.php

View check run for this annotation

Codecov / codecov/patch

includes/Checker/Checks/Plugin_Readme_Check.php#L148

Added line #L148 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 154 in includes/Checker/Checks/Plugin_Readme_Check.php

View check run for this annotation

Codecov / codecov/patch

includes/Checker/Checks/Plugin_Readme_Check.php#L150-L154

Added lines #L150 - L154 were not covered by tests
Expand Down

0 comments on commit ecc4a54

Please sign in to comment.