#13 Practici recomandate pentru cod bun în php http://www.php-fig.org/psr/psr-1/

state: closed opened by: adrianharabula on: 4/17/2017

Ca să scriem cod frumos, putem urmări recomandări legate de scrierea codului PHP

This section of the standard comprises what should be considered the standard coding elements that are required to ensure a high level of technical interoperability between shared PHP code.

Overview

  • Files MUST use only <?php and <?= tags.
  • Files MUST use only UTF-8 without BOM for PHP code.
  • Files SHOULD either declare symbols (classes, functions, constants, etc.) or cause side-effects (e.g. generate output, change .ini settings, etc.) but SHOULD NOT do both.
  • Namespaces and classes MUST follow an “autoloading” PSR: [PSR-0, PSR-4].
  • Class names MUST be declared in StudlyCaps.
  • Class constants MUST be declared in all upper case with underscore separators.
  • Method names MUST be declared in camelCase.

Full page here.

Comments


from: adrianharabula on: 4/20/2017

altădată!

results matching ""

    No results matching ""