If you would like to contribute, please try to adhere to the coding standards I have detailed below, if you have any questions or believe I have missed something, please contact me, ideally all code should adhere to PSR2.
Pull requests should be from a branch in your fork, please also try to give your branch a name that relates to the change/feature you want me to merge. Most importantly, before creating a pull request, please update your fork.
- Use UTF-8 character encoding.
- Unix formatted, (LF).
- A line length of 120 characters, this is not in any way a fixed requirement, please let context dictate, don't make code harder to read by wrapping it to hit a particular line length.
- All code and comments should be in English.
- Spaces for all indenting, I recommend four spaces per tab.
- Please always use
<?php ... ?>
, never<? ... ?>
. - PHP
CONSTANTS
should all be inUPPERCASE
. - PHP keywords should be in
lowercase
, including,true
,false
andnull
. - Braces on their own line for classes, namespaces and functions
- Braces in line for if/while etc
UpperCamelCase
for classes, interfaces etc.lowerCamelCase
for methods and functionslowercase_with_underscores
for multiple word variables/fields
You can read more about PSR at the following link - https://www.php-fig.org/psr/psr-2/