Skip to content

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

Merged
anton-vlasenko merged 6 commits into
trunkfrom
update/document-naming-convention-for-block-library-php-functions
Aug 18, 2023
Merged

anton-vlasenko merged 6 commits into
trunkfrom
update/document-naming-convention-for-block-library-php-functions

Conversation

@anton-vlasenko

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

Copy link
Copy Markdown
Contributor

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

@anton-vlasenko anton-vlasenko added the [Type] Developer Documentation Documentation for developers label Aug 17, 2023
@anton-vlasenko
anton-vlasenko marked this pull request as ready for review August 17, 2023 21:28

@gziolo gziolo left a comment

Copy link
Copy Markdown
Member

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.

Comment thread packages/block-library/README.md Outdated

### 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
Copy Markdown
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:

@anton-vlasenko anton-vlasenko Aug 18, 2023 •

Copy link
Copy Markdown
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
@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
Copy Markdown
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.

@github-actions github-actions Bot added this to the Gutenberg 16.6 milestone Aug 18, 2023
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