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

The PHP declare construct #2422

Open
henrywright opened this issue Feb 15, 2024 · 2 comments
Open

The PHP declare construct #2422

henrywright opened this issue Feb 15, 2024 · 2 comments

Comments

@henrywright
Copy link

Does WordPress Coding Standards have a rule for the PHP declare construct?

It can be used in a number of ways. For example

<?php
// These are the same

declare(ticks=1) {
    // Entire script here
}

declare(ticks=1);
// Entire script here

Also, in the example, you'll see I've not used spacing inside the parenthesis. Guidance for all of this appears to be missing from the standard.

@jrfnl
Copy link
Member

jrfnl commented Feb 15, 2024

@henrywright The proposed standards for the declare statement (under the heading "Declare statements / strict typing") yielded no consensus, which means that WP currently doesn't have a coding standard for declare statements.

@henrywright
Copy link
Author

Thanks for the link @jrfnl

For now for my own project I'll go with the proposal but I'll keep an eye on the standard in case you adopt a modified version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants