zendframework/zend-coding-standard

This package is abandoned and no longer maintained. The author suggests using the laminas/laminas-coding-standard package instead.

Zend Framework coding standard

Maintainers

👁 zendframework

Package info

github.com/zendframework/zend-coding-standard

pkg:composer/zendframework/zend-coding-standard

Statistics

Installs: 222 445

Dependents: 263

Suggesters: 0

Stars: 41

Open Issues: 11

2.0.0alpha4 2019-11-05 16:19 UTC

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

BSD-3-Clause cf5b336141d34e9c15c7aff7da429ce5be9905ff

ZendFrameworkzfCoding Standard


README

Repository abandoned 2019-12-31

This repository has moved to laminas/laminas-coding-standard.

Repository with all coding standard ruleset for Zend Framework repositories.

Installation

  1. Install the module via composer by running:

    $ composer require --dev zendframework/zend-coding-standard
  2. Add composer scripts into your composer.json:

    "scripts": {
     "cs-check": "phpcs",
     "cs-fix": "phpcbf"
    }
  3. Create file phpcs.xml on base path of your repository with content:

    <?xml version="1.0"?>
    <ruleset name="Zend Framework Coding Standard">
     <rule ref="./vendor/zendframework/zend-coding-standard/ruleset.xml"/>
    
     <!-- Paths to check -->
     <file>config</file>
     <file>src</file>
     <file>test</file>
    </ruleset>

You can add or exclude some locations in that file. For a reference please see: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml

Usage

  • To run checks only:

    $ composer cs-check
  • To automatically fix many CS issues:

    $ composer cs-fix