2017 © Pedro Peláez
 

library codeigniter4-standard

CodeIgniter 4 Standard for PHP_CodeSniffer 3.

image

codeigniter4/codeigniter4-standard

CodeIgniter 4 Standard for PHP_CodeSniffer 3.

  • Tuesday, December 12, 2017
  • by jim-parry
  • Repository
  • 14 Watchers
  • 36 Stars
  • 4,419 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 9 Forks
  • 4 Open issues
  • 14 Versions
  • 37 % Grown

The README.md

Deprecated

The new CodeIgniter Coding Standard is officially published! This switch uses PHP CS Fixer instead of Code Sniffer and applies a lot of changes (most notably, PSR-12 compliance). Visit the repo for more information. This library will remain in place but may not be maintained and is no longer considered compliant with official CodeIgniter 4 framework styles., (*1)

CodeIgniter4-Standard

CodeIgniter 4 coding standard for use with PHP_CodeSniffer 3., (*2)

Version 1, (*3)

Master Develop
Build Status Build Status
Coverage Status Coverage Status

This is currently a work in progress., (*4)

Requested at: https://github.com/bcit-ci/CodeIgniter4/issues/182, (*5)

Requirements

PHP_CodeSniffer 3. (3.1.1 or greater)., (*6)

PHP (7.1 or greater) with mbstring extension., (*7)

Install

Composer install

cd /Path/To/MyProject composer require codeigniter4/codeigniter4-standard --dev, (*8)

Set the phpcs standard path and phpcbf standard path in your editor/plugin config to:, (*9)

/Path/To/MyProject/vendor/codeigniter4/codeigniter4-standard/CodeIgniter4/ruleset.xml, (*10)

Download install

Download CodeIgniter4-Standard., (*11)

Set standard paths to your local filesystem:, (*12)

'/Path/To/CodeIgniter4-Standard/CodeIgniter4/ruleset.xml', (*13)

Global install

Globally install PHP_CodeSniffer with one of the various methods., (*14)

Once complete you should be able to execute phpcs -i on the command line., (*15)

You should see something like:-, (*16)

The installed coding standards are MySource, PEAR, PSR1, PSR2, Squiz and Zend., (*17)

Either clone this repository..., (*18)

git clone -b master --depth 1 https://github.com/bcit-ci/CodeIgniter4-Standard.git., (*19)

or use composer..., (*20)

composer global require codeigniter4/codeigniter4-standard, (*21)

or download., (*22)

Take note of the paths where they were installed., (*23)

Create a symbolic link to the CodeIgniter4-Standard/CodeIgniter4 directory in php_codesniffer/src/Standards/ eg., (*24)

ln -s ~/Documents/Projects/CodeIgniter4-Standard/CodeIgniter4 ~/.composer/vendor/squizlabs/php_codesniffer/src/Standards/CodeIgniter4, (*25)

or copy the CodeIgniter4-Standard/CodeIgniter4 directory to php_codesniffer/src/Standards/, (*26)

Executing phpcs -i should now show CodeIgniter4 installed eg., (*27)

The installed coding standards are CodeIgniter4, MySource, PEAR, PSR1, PSR2, Squiz and Zend., (*28)

You should now be able to set 'CodeIgniter4' as the phpcs standard in the plugin/editor/IDE of your choice., (*29)

Command line use

Sniffing errors & warnings (reporting).

Single file..., (*30)

phpcs /Path/To/MyFile.php --standard='/Path/To/CodeIgniter4-Standard/CodeIgniter4/ruleset.xml', (*31)

or if globally installed., (*32)

phpcs /Path/To/MyFile.php --standard=CodeIgniter4, (*33)

Directory (recursive)., (*34)

phpcs /Path/To/MyProject --standard='/Path/To/CodeIgniter4-Standard/CodeIgniter4/ruleset.xml', (*35)

or if globally installed., (*36)

phpcs /Path/To/MyProject --standard=CodeIgniter4, (*37)

Fixing fixable errors.

Single file., (*38)

phpcbf /Path/To/MyFile.php --standard='/Path/To/CodeIgniter4-Standard/CodeIgniter4/ruleset.xml', (*39)

or if globally installed., (*40)

phpcbf /Path/To/MyFile.php --standard=CodeIgniter4, (*41)

Directory (recursive)., (*42)

phpcbf /Path/To/MyProject --standard='/Path/To/CodeIgniter4-Standard/CodeIgniter4/ruleset.xml', (*43)

or if globally installed., (*44)

phpcbf /Path/To/MyProject --standard=CodeIgniter4, (*45)

Credits

Thanks to Greg Sherwood, Marc McIntyre, Andy Grunwald, Thomas Ernest and Erik Torsner, for providing open source code which helped me build this standard and a big thanks to Squiz Labs for creating PHP_CodeSniffer., (*46)

Thanks to EllisLab for originally creating CodeIgniter and the British Columbia Institute of Technology for continuing the project. Thanks to all the developers and contibutors working on CodeIgniter 4., (*47)

The Versions

12/12 2017

dev-master

9999999-dev

CodeIgniter 4 Standard for PHP_CodeSniffer 3.

  Sources   Download

MIT

The Development Requires

12/12 2017

1.0.1

1.0.1.0

CodeIgniter 4 Standard for PHP_CodeSniffer 3.

  Sources   Download

MIT

The Development Requires

12/12 2017

dev-develop

dev-develop

CodeIgniter 4 Standard for PHP_CodeSniffer 3.

  Sources   Download

MIT

The Development Requires

11/12 2017

1.0.0

1.0.0.0

CodeIgniter 4 Standard for PHP_CodeSniffer 3.

  Sources   Download

MIT

The Development Requires

10/12 2017

1.0.0-beta0012

1.0.0.0-beta0012

CodeIgniter 4 Standard for PHP_CodeSniffer 3.

  Sources   Download

MIT

The Development Requires

26/07 2017

1.0.0-beta0011

1.0.0.0-beta0011

CodeIgniter 4 Standard for PHP_CodeSniffer 3.

  Sources   Download

MIT

The Development Requires

26/07 2017

1.0.0-beta0010

1.0.0.0-beta0010

CodeIgniter 4 Standard for PHP_CodeSniffer 3.

  Sources   Download

MIT

The Development Requires

25/07 2017

1.0.0-beta0009

1.0.0.0-beta0009

CodeIgniter 4 Standard for PHP_CodeSniffer 3.

  Sources   Download

MIT

The Development Requires

21/07 2017

1.0.0-beta0008

1.0.0.0-beta0008

CodeIgniter 4 Standard for PHP_CodeSniffer 3.

  Sources   Download

MIT

The Development Requires

13/07 2017

1.0.0-beta0007

1.0.0.0-beta0007

CodeIgniter 4 Standard for PHP_CodeSniffer 3.

  Sources   Download

MIT

The Development Requires

13/07 2017

1.0.0-beta0006

1.0.0.0-beta0006

CodeIgniter 4 Standard for PHP_CodeSniffer 3.

  Sources   Download

MIT

The Development Requires

03/07 2017

1.0.0-beta0005

1.0.0.0-beta0005

CodeIgniter 4 Standard for PHP_CodeSniffer 3.

  Sources   Download

MIT

The Development Requires

30/06 2017

1.0.0-beta0004

1.0.0.0-beta0004

CodeIgniter 4 Standard for PHP_CodeSniffer 3.

  Sources   Download

MIT

The Development Requires

30/06 2017

1.0.0-beta0003

1.0.0.0-beta0003

CodeIgniter 4 Standard for PHP_CodeSniffer 3.

  Sources   Download

MIT

The Development Requires