Skip to content

Commit

Permalink
Add missing check
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Jul 15, 2021
1 parent edbce53 commit da5960a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/MakePotCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Gettext\Merge;
use Gettext\Translation;
use Gettext\Translations;
use Gettext\Utils\ParsedComment;
use WP_CLI;
use WP_CLI_Command;
use WP_CLI\Utils;
Expand Down Expand Up @@ -677,10 +678,10 @@ protected function audit_strings( $translations ) {
$comments = array_filter(
$comments,
function ( $comment ) {
/** @var string $comment */
/** @var ParsedComment|string $comment */
/** @var string $file_header */
foreach ( $this->get_file_headers( $this->project_type ) as $file_header ) {
if ( 0 === strpos( $comment, $file_header ) ) {
if ( 0 === strpos( ( $comment instanceof ParsedComment ? $comment->getComment() : $comment ), $file_header ) ) {
return null;
}
}
Expand Down

0 comments on commit da5960a

Please sign in to comment.