Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WordPress build: Add newlines after PHP annotations #986

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

adamziel
Copy link
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
5 checks passed
@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