Skip to content

WordPress build: Add newlines after PHP annotations#986

Merged
adamziel merged 1 commit intotrunkfrom
add-newlines-after-annotations
Jan 30, 2024
Merged

WordPress build: Add newlines after PHP annotations#986
adamziel merged 1 commit intotrunkfrom
add-newlines-after-annotations

Conversation

@adamziel
Copy link
Copy Markdown
Collaborator

@adamziel adamziel commented Jan 30, 2024

Adds a newline character after every PHP annotation.

Rationale

Loading WordPress on PHP 7.4 yields the following error:

Parse error: syntax error, unexpected 'has' (T_STRING) in /wordpress/wp-includes/class-wp-recovery-mode-email-service.php on line 4

This is caused by the minification of PHP files via php -w.

PHP 8.0, which is currently used, outputs:

<?php
 #[AllowDynamicProperties] final class WP_Recovery_Mode_Email_Service {  /* ... code ... */ $message = __( 'Howdy!', '

WordPress has a built-in feature ...

The class declaration is treated as a comment by PHP 7.4.

However, PHP 7.4 outputs:

<?php
final class WP_Recovery_Mode_Email_Service {  /* ... code ... */ $message = __( 'Howdy!', '

WordPress has a built-in feature ...

Note the missing annotation.

Closes #985

Testing instructions

Confirm the CI tests pass

@adamziel adamziel added [Type] Bug An existing feature does not function as intended [Aspect] WordPress labels Jan 30, 2024
@adamziel adamziel merged commit ceb8975 into trunk Jan 30, 2024
@adamziel adamziel deleted the add-newlines-after-annotations branch January 30, 2024 17:35
@adamziel adamziel mentioned this pull request Jan 31, 2024
adamziel added a commit that referenced this pull request Jan 31, 2024
Rebuilds WordPress assets to include the changes from
#986
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Aspect] WordPress [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Annotations-related syntax errors in the minified WordPress build

1 participant