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

Format code with PSR #78

Open
EarthlingDavey opened this issue Mar 5, 2024 · 3 comments
Open

Format code with PSR #78

EarthlingDavey opened this issue Mar 5, 2024 · 3 comments

Comments

@EarthlingDavey
Copy link
Contributor

As @wilson1000-MoJ suggested in this review. #77 (comment)

It's important to use a standard for code readability, and minimise that chance of merge conflicts.

Let's revisit.

@EarthlingDavey
Copy link
Contributor Author

@EmilyHazlehurst has raised an important point about using PHPDoc comments to describe functions. #91 (comment)

e.g.

/**
* Prevent all single posts, of any post type, from using the document(s) slug.
*
* @param bool $bad_slug Whether the slug is bad or not
* @param string $slug The document slug
* @return bool The sum of the two numbers.
*/

https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/

+1 from me. Let's have a team discussion.

@EarthlingDavey
Copy link
Contributor Author

EarthlingDavey commented Mar 18, 2024

Adding to this, we could potentially:

  • php format on save.
  • pre commit hook to run phpcs and/or unit tests etc.
  • CI build for generating browsable docs. WP use phpDocumentor, I've had a trial and it looks really nice!

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

1 participant