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-12: Extended Coding Style. 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 import 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:
<?phpfunctionsetAcme($acme) { if ($acmeinstanceof Acme) { $this->acme = $acme; return$this; } else { thrownewphpFastCacheInvalidArgumentException('Invalid acme instance'); } }
- This example can be safely replaced by this one:
<?phpfunctionsetAcme($acme) { if ($acmeinstanceof Acme) { $this->acme = $acme; return$this; } thrownewphpFastCacheInvalidArgumentException('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.