2017 © Pedro Peláez
 

coding-standard pbweb-coding-standard

PB Web Media coding standard

image

pbweb/pbweb-coding-standard

PB Web Media coding standard

  • Monday, February 20, 2017
  • by DemonTPx
  • Repository
  • 2 Watchers
  • 0 Stars
  • 173 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 2 % Grown

The README.md

PB Web Media PHPCS coding standard

This is the PHPCS ruleset we use. It is based on the Symfony2 coding standard provided by Escape Studios and features:, (*1)

  • Rule which requires spaces around string concat (.) operator
  • Rule which requires spaces around unary not (!) operator

It also disables some rules which causes the following:, (*2)

  • Space after opening bracket are now allowed (conflicts with spaces around unary not rule, eg.: some_func( ! $value))
  • Function comments are no longer required (PHP7 type hinting fixes this)
  • No need to order class methods by scope
  • Multi line function declaration may be on the following line

Install globally via composer:

Install using:, (*3)

composer global require pbweb/pbweb-coding-standard

And configure phpcs to use the Pbweb standard, (*4)

phpcs --config-set installed_paths ${HOME}/.composer/vendor/pbweb/pbweb-coding-standard/,${HOME}/.composer/vendor/escapestudios/symfony2-coding-standard/
phpcs --config-set default_standard Pbweb

Install in your project only:

Install using:, (*5)

composer require pbweb/pbweb-coding-standard

Phing configuration

Example phing target:, (*6)

<target name="check:cs" description="Checks coding standard.">
    <echo msg="Checking coding standard..." />
    <phpcodesniffer standard="Pbweb"
                    showSniffs="true"
                    showWarnings="true">
        <fileset refid="sourcecode" />
        <formatter type="checkstyle" outfile="${dir.reports}/checkstyle.xml" />
        <config name="installed_paths" value="${project.basedir}/vendor/pbweb/pbweb-coding-standard,${project.basedir}/vendor/escapestudios/symfony2-coding-standard" />
    </phpcodesniffer>
</target>

The Versions

20/02 2017

dev-master

9999999-dev

PB Web Media coding standard

  Sources   Download

MIT

The Requires

 

phpcs symfony code sniffer coding standard

20/02 2017

1.1.1

1.1.1.0

Pbweb CodeSniffer ruleset

  Sources   Download

proprietary

The Requires

 

phpcs symfony 2 coding standard

20/02 2017

1.1

1.1.0.0

Pbweb CodeSniffer ruleset

  Sources   Download

proprietary

The Requires

 

phpcs symfony 2 coding standard

07/05 2015

1.0

1.0.0.0

Pbweb CodeSniffer ruleset

  Sources   Download

proprietary

The Requires

 

phpcs symfony 2 coding standard