ClassicPress PetitionsClassicPress Petitions
This is a read-only archive. Post or comment on the live version of this page on our forums.

Implement a coding standard

May 1, 2019 · 04:46 · Joi Glifberg
Description

WordPress has their own php coding standard for core. Although far from all code in core actually follows the standard.
I would love for ClassicPress to follow industry standard PSR-2.

Voters
+11 more
Discussion
invisnet

Definitely gets my vote, but it's a huge job and it'd make merging changes from WP harder.

Joi Glifberg

@invisnet Agreed, but there's automated tools that can help migrate big parts of the core. Another option would be to only allow PSR-2 in newly committed code.

James Nylen

When we move to v2 we will have more flexibility here, for example, we could begin converting individual plugins to PSR-2 without causing (more) difficulties when porting changes back from WordPress.

Joi: please elaborate about the automated tools. In my experience these tools (phpcs) are far from perfect, especially with codebases that contain a lot of "historical oddities" like WordPress/ClassicPress.

Ed Sutherland

Generally, I would love to see WordPress code be updated to modern standards and away from the decade-old hooks and bloated php calls.

William Patton

Is this petition about only using an autoloader (PSR-2)?

Code Potent

I wouldn't think so, William... a coding standard should cover everything right down to spaces vs. tabs.

Laurence Bahiirwa

Would you consider PSR-4?

stefanos82

PSR-2 has been deprecated and PSR-12 is recommended now.