Skip to content

forgie1/codestyle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ArtFocus Coding Standards for PHP CodeSniffer

  • Based on Consistence, so read it carefully.
  • But it differs in some cases:
    • Arrays: Arrays without key are allowed also when the first key is specified (Nette\Database $criteria).
    • Comments: Inline comments are allowed (code conditions, code folding).
    • Comments: Type parameters are not checked (allow shortcuts like int, bool).
    • Constants: Uppercase constants including TRUE, FALSE, NULL (Nette Code Style).
    • Formatting: There is not space after type cast.
    • Formatting: Heredoc syntax is allowed (eg. in tests).
    • Functions: Opening brace of function with multiline arguments must be on the same line as closing parenthesis.
    • Strings: Double quotes are permitted when contains a variable.
    • Whitespace: There is no space after type cast.
    • and some other differences.

Example Usage

Install into your project the best via Composer:

$ composer require artfocus/codestyle

Run PHP CodeSniffer like this:

$ vendor/bin/phpcs --standard=/path/to/Artfocus/ruleset.xml -sp src tests

Versioning

This packages uses semver.org.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages