dngb/phalcon-coding-standard

CodeSniffer ruleset for the Phalcon coding standard (PCG Cube flavor)

Installs: 59 746

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:coding-standard

dev-master 2018-08-15 13:46 UTC

This package is not auto-updated.

Last update: 2024-03-17 02:37:10 UTC


README

A coding standard to check against the Phalcon coding standards, with slight modifications.

Important note: Please be careful using this library, as it is for internal usage, and probably will not be maintained

Project fork from: (https://github.com/karen-nalbandian/phalcon-coding-standard) + exclude NamingConventions.ValidVariableName.NotCamelCaps

Differences

The following standards has been modified:

  • added the Phalcon.Commenting.FunctionComment.MissingParamType
  • removed the Phalcon.Commenting.FunctionComment.SpacingAfterParamType
  • removed the Phalcon.Commenting.Annotations.Invalid
  • removed the Phalcon.Functions.Arguments.Invalid
  • removed the Squiz.Strings.ConcatenationSpacing.PaddingFound
  • removed the PSR2.Classes.PropertyDeclaration.Underscore
  • removed the Zend.NamingConventions.ValidVariableName.ContainsNumbers
  • removed the Zend.NamingConventions.ValidVariableName.MemberVarContainsNumbers
  • removed the Zend.NamingConventions.ValidVariableName.NotCamelCaps
  • removed the Generic.Files.LineEndings.InvalidEOLChar

Installation

Composer

This standard can be installed with the Composer dependency manager.

  1. Install Composer

  2. Install the coding standard as a dependency of your project

     composer require --dev dngb/phalcon-coding-standard:dev-master
    
  3. Add the coding standard to the PHP_CodeSniffer install path

     vendor/bin/phpcs --config-set installed_paths vendor/dngb/phalcon-coding-standard
    
  4. Check the installed coding standards for "Phalcon"

     vendor/bin/phpcs -i
    
  5. Done!

     vendor/bin/phpcs /path/to/code
    

### Stand-alone

  1. Install PHP_CodeSniffer

  2. Checkout this repository

     git clone https://github.com/dngb/phalcon-coding-standard.git
    
  3. Add the coding standard to the PHP_CodeSniffer install path

     phpcs --config-set installed_paths /path/to/phalcon-coding-standard
    

    Or copy/symlink this repository's "Phalcon"-folder inside the phpcs Standards directory

  4. Check the installed coding standards for "Phalcon"

     phpcs -i
    
  5. Done!

     phpcs /path/to/code