This project has a set of PHP_CodeSniffer rules that are based on doctrine/coding-standard rules, but with some small changes and additions.
- Inline comments should begin with a space, for example:
// This is an inline comment
- Docblock annotation groups are grouped a bit different
- Empty catch in try...catch must have a comment explaining why the exception is not handled
- There shouldn't be a space after the negation operator
if (!$cond)
- No space before colon in return type:
public function test(): void
- Property doc comments shouldn't be a single line, but multiline instead:
/**
* @var int
*/
- Variable/property/function names should be camelCased:
$camelCaseVariable
- A @throw tag comment doesn't need to end in full stop:
class Abc
{
/**
* @throw InvalidArgumentException This is a comment that doesn't end in a full stop
*/
public function def(): void
{
...
}