Skip to content

Latest commit

 

History

History
44 lines (27 loc) · 1.96 KB

readme.asciidoc

File metadata and controls

44 lines (27 loc) · 1.96 KB

Koch’s Goldstandard for PHP - A Coding Standard

This repository contains a set of code sniffs for PHP_CodeSniffer. Build Status

This standard enforces:

  • PSR-0, PSR-1 and PSR-2. The standards were approved by the PHP Framework Interoperability Group.

  • the removal of old and deprecated PHP functions (This is helpful, when working with legacy code.)

  • the usage of faster functions. Which in fact are premature or micro optimizations. Uh, oh! That’s BAD for sure :)

Requirements

PHP 5.3+

Installation

  • PHP_CodeSniffer is installed via Composer

  • Clone this repository

  • Create a symlink PHP/CodeSniffer/Standards/Goldstandard pointing to the Goldstandard directory

    • ln -s [somewhere]/PHP/CodeSniffer/Standards/Goldstandard /Goldstandard

Usage

  • Use the coding standard with phpcs --standard=Goldstandard

  • You might also set it as default standard phpcs --config-set default_standard Goldstandard

  • If you didn’t symlink or install it, then reference it by path phpcs --standard=path/to/Goldstandard path/to/code

IDE Integration

NetBeans

http://plugins.netbeans.org/plugin/40282/phpmd-php-codesniffer-plugin

PHPStorm

http://www.jetbrains.com/phpstorm/webhelp/using-php-code-sniffer-tool.html

Zend Studio

http://files.zend.com/help/Zend-Studio/content/working_with_php_codesniffer.htm