Help is very welcomed, but code contributions must be done in respect of PSR-2.
Automatic fixer — PHP-CS-Fixer
--level=all is used even though it is not part of a standard simply because we like the code to be consistent.
To validate new code added to Elastica run the following command in the top directory. It will show you if your code follows the coding guidelines.
Validator — PHP_CodeSniffer
- Since #300, all classes MUST be defined using namespaces.
- When using classes outside the namespace, you MUST use the
- When referencing classes not in a namespace like
Exception, you MUST NOT use a
usestatement, simply add a backslash:
- When class names are used in strings, they MUST be fully qualified, but SHOULD not use a leading backslash. Example:
- When documenting, classes MUST be fully qualified with a leading backslash. See #301.