Fork the project, create a feature branch, and send us a pull request. Preferably on a distinct branch.
To ensure a consistent code base, you should make sure the code follows the PSR-2 Coding Standards. You can also run php-cs-fixer with the configuration file that can be found in the project root directory.
If you would like to help, take a look at the list of open issues.
As of the V7 your contributions MUST comply the following standards:
- To improve Opcode efficiency, you MUST prefix core function by a '\'
- E.g:
$var = \str_replace('value', '', $var);
- E.g:
- To improve Opcode efficiency, you MUST prefix core constants by a '\'
- E.g:
$dateFormat = \DATE_ISO8601
- E.g:
- Do not imports non-namespaced classes, use an absolute path instead:
- E.g:
$date = new \DateTime();
- E.g:
- Unneeded/inconsistent
else
statements have to be shortened.- E.g:
<?php
function setAcme($acme)
{
if ($acme instanceof Acme) {
$this->acme = $acme;
return $this;
} else {
throw new phpFastCacheInvalidArgumentException('Invalid acme instance');
}
}
- This example can be safely replaced by this one:
<?php
function setAcme($acme)
{
if ($acme instanceof Acme) {
$this->acme = $acme;
return $this;
}
throw new phpFastCacheInvalidArgumentException('Invalid acme instance');
}
Read this thread on StackExchange for more information This list is non-exhaustive and will may subject to evolve at any time.