Language and development rules: Difference between revisions

Jump to navigation Jump to search
Line 72: Line 72:
** Files must be saved with Unix format (LF) and not Windows (CR/LF). Unif format is compatible on all OS like Unix like, Windows, Mac, but the Windows text file format is no working on some PHP under Unix.
** Files must be saved with Unix format (LF) and not Windows (CR/LF). Unif format is compatible on all OS like Unix like, Windows, Mac, but the Windows text file format is no working on some PHP under Unix.
** Smart tags PHP are not used. PHP code section must start with '''<?php'''
** Smart tags PHP are not used. PHP code section must start with '''<?php'''
** But there is an exception of length of line: We accept 1000 characters on same line if chars are not  
** But there is an exception of length of line: We accept 1000 characters on same line instead of 80 that is really to low. In most cases, we never go over 80, but sometimes (when declaring a list of reference arrays, like into descriptor files, it is better to have long lines instead of long page with code content that is just list of declaration and does not contains any logic).
** The other exception is that we don't replace the tab with space. This make lot of editor crazy and break some autoformat features broken.
** The other exception is that we don't replace the tab with space. This make lot of editor crazy and break some autoformat features broken.
You can use the file dev/codesniffer/ruleset.xml as rule file to control coding style with PHPCodeSniffer.
You can use the file dev/codesniffer/ruleset.xml as rule file to control coding style with PHPCodeSniffer.

Navigation menu