Skip to content

Commit 5787388

Browse files
committed
Fix magic tag headers in Migrate PHP component
Signed-off-by: Scott Kingsley Clark <scott@skc.dev>
1 parent c7f9940 commit 5787388

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

components/Migrate-PHP/Migrate-PHP.php

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,7 @@ private function migrate_template( $object_id, bool $cleanup ) {
293293
$extra_headers = '';
294294

295295
if ( false !== strpos( $template_code, '{@' ) ) {
296-
// phpcs:ignore PluginCheck.CodeAnalysis.Heredoc.NotAllowed
297-
$extra_headers = <<<PHPTEMPLATE
298-
* Magic Tags: Enabled
299-
PHPTEMPLATE;
300-
296+
$extra_headers = "\n * Magic Tags: Enabled";
301297
}
302298

303299
// phpcs:ignore PluginCheck.CodeAnalysis.Heredoc.NotAllowed
@@ -421,30 +417,16 @@ private function migrate_page( $object_id, bool $cleanup ) {
421417
$this->setup_file_path( $file_path_for_content );
422418

423419
if ( '_custom' !== $page_template && 'blank' !== $page_template ) {
424-
$extra_notes .= "\n";
425-
// phpcs:ignore PluginCheck.CodeAnalysis.Heredoc.NotAllowed
426-
$extra_notes .= <<<PHPTEMPLATE
427-
*
428-
* @see {$page_template} for the template where this will get called from.
429-
PHPTEMPLATE;
420+
$extra_notes .= "\n *\n * @see {$page_template} for the template where this will get called from.";
430421
}
431422

432423
// Set the file path we will write to as the one for the content specific template.
433424
$file_path = $file_path_for_content;
434-
$extra_notes .= "\n";
435-
// phpcs:ignore PluginCheck.CodeAnalysis.Heredoc.NotAllowed
436-
$extra_notes .= <<<PHPTEMPLATE
437-
*
438-
* This template is only used for pods_content() calls.
439-
PHPTEMPLATE;
425+
$extra_notes .= "\n *\n * This template is only used for pods_content() calls.";
440426
}
441427

442428
if ( false !== strpos( $template_code, '{@' ) ) {
443-
$extra_headers = "\n";
444-
// phpcs:ignore PluginCheck.CodeAnalysis.Heredoc.NotAllowed
445-
$extra_headers .= <<<PHPTEMPLATE
446-
* Magic Tags: Enabled
447-
PHPTEMPLATE;
429+
$extra_headers = "\n * Magic Tags: Enabled";
448430
}
449431

450432
// phpcs:ignore PluginCheck.CodeAnalysis.Heredoc.NotAllowed

0 commit comments

Comments
 (0)