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

Document the naming convention for block-library PHP functions #53777

Conversation

anton-vlasenko
Copy link
Contributor

@anton-vlasenko anton-vlasenko commented Aug 17, 2023

What?

This PR is intended to document the following naming convention: #52769 (comment).
Fixes #53732.

Why?

Documenting every naming convention is essential.

How?

  • Add the naming convention to the documentation.
  • Include a link to the documentation in ValidBlockLibraryFunctionNameSniff.

Testing Instructions

Please review the suggested changes for accuracy, grammar, and style errors.

Testing Instructions for Keyboard

Screenshots or screencast

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the follow-up. I had only a minor note. Otherwise, this looks great.

@@ -119,4 +119,23 @@ To find out more about contributing to this package or Gutenberg as a whole, ple
}
```

### Naming convention for PHP functions

All PHP function names within the subdirectories of the `packages/block-library/src/` directory should start with one of the following prefixes:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be clarified that it applies to function definitions? Example:

Suggested change
All PHP function names within the subdirectories of the `packages/block-library/src/` directory should start with one of the following prefixes:
All declared PHP function names within the subdirectories of the `packages/block-library/src/` directory should start with one of the following prefixes:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Fixed in 0586c63.

@gziolo gziolo added the [Package] Block library /packages/block-library label Aug 18, 2023
@anton-vlasenko anton-vlasenko merged commit 3172353 into trunk Aug 18, 2023
49 checks passed
@anton-vlasenko anton-vlasenko deleted the update/document-naming-convention-for-block-library-php-functions branch August 18, 2023 13:58
@anton-vlasenko
Copy link
Contributor Author

Thank you for the follow-up. I had only a minor note. Otherwise, this looks great.

Thank you for the code review, @gziolo. I appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Block library /packages/block-library [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Naming convention for PHP functions in the block-library package should be documented
2 participants