List of highly-regarded PHP style guides?

后端 未结 3 876
南笙
南笙 2020-12-24 01:31

I\'ve recently been shaking up my coding habits and have been toying with various approaches to coding style... things like using a space between method call parentheses and

相关标签:
3条回答
  • 2020-12-24 01:59

    This is really for Codeigniter, but it's still PHP and an easy read and I like the styles used:

    https://codeigniter.com/user_guide/general/styleguide.html

    0 讨论(0)
  • 2020-12-24 02:14

    The PHP Standards Recommendations by the PHP Framework Interoperability Group are a good resource. AFAIK the standards are highly regarded. They attempt to be a collection and unification of what different frameworks have decided to use as their own standards.

    I would say for basic PHP coding, especially PSR-1 and PSR-12 are well worth a read.

    PSR-2′s purpose [was] to have a single style guide for PHP code that results in uniformly formatted shared code. [The PSR-12] specification extends, expands and replaces PSR-2, the coding style guide and requires adherence to PSR-1, the basic coding standard.

    There are several accepted standard recommendations.

    • PSR-1: Basic Coding Standard
    • PSR-12: Extended Coding Style Guide
    • All PSRs
    0 讨论(0)
  • 2020-12-24 02:16

    I just use the PEAR coding standards.

    http://pear.php.net/manual/en/standards.php

    0 讨论(0)
提交回复
热议问题