microformats / php-mf2

php-mf2 is a pure, generic microformats-2 parser for PHP. It makes HTML as easy to consume as JSON.
Creative Commons Zero v1.0 Universal
194 stars 38 forks source link

Specify coding standard #188

Open gRegorLove opened 6 years ago

gRegorLove commented 6 years ago

https://www.php-fig.org/psr/psr-1/ and https://www.php-fig.org/psr/psr-2/

In addition, should make a choice among $StudlyCaps, $camelCase, or $under_score properties. Historically php-mf2 has used $camelCase so I'm fine with that.

pfefferle commented 6 years ago

I would vote for camel case

aaronpk commented 6 years ago

I would vote for whatever the majority of the code is currently written in

Zegnat commented 6 years ago

I too would vote camelCase. The PSR uses camelCase in almost all of its examples. Symfony defines camelCase in their coding standards. So did Zend (and they will automatically test for it in the future). There are probably a few more big projects that could be added to this list.

(To this day I am a little surprised the PSR have not documented naming conventions. Not even the upcoming PSR-12 Extended Coding Style Guide.)

I think what will be more important for a coding standard is to pick something that is automatically testable (PHP_CodeSniffer) and preferably automatically fixable (PHP_CodeSniffer or PHP CS Fixer).