Skip to content

timozachi/coding-standard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coding Standard

License Build Status Total Downloads Latest Stable Version Unstable Version

This project has a set of PHP_CodeSniffer rules that are based on doctrine/coding-standard rules, but with some small changes and additions.

Differences from doctrine coding-standards

  • 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
    {
        ...
}

About

Coding Standard for tzachi projects

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages