A brief description of code conventions this project follows.
- Follows SOLID principles
- Reduce lines of code where possible
- Reduce coupling (Law of Demeter)
- Favor latest stable PHP7 features
- Checks must pass (code style, static analysis & unit tests)
- Follows PSR-2 with Symfony Style
usestatements are declared in alpha-orderusestatements forMsgPhp\namespace are grouped by deepest common namespace
<?php
// wrong
use MsgPhp\SomeB;
use MsgPhp\SomeA;
use MsgPhp\Some\SomeC;
use Other\SomeOtherB;
use Other\Some\SomeOtherC;
use Other\SomeOtherA;
// right
use MsgPhp\Some\SomeC;
use MsgPhp\{SomeA, SomeB};
use Other\Some\SomeOtherC;
use Other\SomeOtherA;
use Other\SomeOtherB;- Follows PHPStan level max
- Exclude- and ignore-rules are discussed per case / topic
- Add comments if needed for either clarification or static analysis (might result in e.g. partial
@paramannotations) - Inline
@varannotations (/** @var Some $some*/) - Interfaces must have a description with its purpose (at the class- as well as the method-level)
- No usage of
@inheritdoc
- Intended object values are type hinted (
@param object $valueand@return object)
- All of the above, in general, apply to unit tests as well