- Notifications
You must be signed in to change notification settings - Fork13
DEPRECATED! CodeIgniter 4 Coding Standard for PHP_CodeSniffer 3.
License
codeigniter4/coding-standard
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
The newCodeIgniter 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 longerconsidered compliant with official CodeIgniter 4 framework styles.
CodeIgniter 4 coding standard for use withPHP_CodeSniffer 3.
Version 1
| Master | Develop |
|---|---|
This is currently a work in progress.
Requested at:codeigniter4/CodeIgniter4#182
PHP_CodeSniffer 3. (3.1.1 or greater).
PHP (7.1 or greater) with mbstring extension.
cd /Path/To/MyProjectcomposer require codeigniter4/codeigniter4-standard --dev
Set thephpcs standard path andphpcbf standard path in your editor/plugin config to:
/Path/To/MyProject/vendor/codeigniter4/codeigniter4-standard/CodeIgniter4/ruleset.xml
DownloadCodeIgniter4-Standard.
Setstandard paths to your local filesystem:
'/Path/To/CodeIgniter4-Standard/CodeIgniter4/ruleset.xml'
Globallyinstall PHP_CodeSniffer with one of the various methods.
Once complete you should be able to executephpcs -i on the command line.
You should see something like:-
The installed coding standards are MySource, PEAR, PSR1, PSR2, Squiz and Zend.
Either clone this repository...
git clone -b master --depth 1 https://github.com/bcit-ci/CodeIgniter4-Standard.git.
or use composer...
composer global require codeigniter4/codeigniter4-standard
or download.
Take note of the paths where they were installed.
Create a symbolic link to theCodeIgniter4-Standard/CodeIgniter4 directory inphp_codesniffer/src/Standards/ eg.
ln -s ~/Documents/Projects/CodeIgniter4-Standard/CodeIgniter4 ~/.composer/vendor/squizlabs/php_codesniffer/src/Standards/CodeIgniter4
or copy theCodeIgniter4-Standard/CodeIgniter4 directory tophp_codesniffer/src/Standards/
Executingphpcs -i should now show CodeIgniter4 installed eg.
The installed coding standards are CodeIgniter4, MySource, PEAR, PSR1, PSR2, Squiz and Zend.
You should now be able to set 'CodeIgniter4' as the phpcs standard in the plugin/editor/IDE of your choice.
Single file...
phpcs /Path/To/MyFile.php --standard='/Path/To/CodeIgniter4-Standard/CodeIgniter4/ruleset.xml'
or if globally installed.
phpcs /Path/To/MyFile.php --standard=CodeIgniter4
Directory (recursive).
phpcs /Path/To/MyProject --standard='/Path/To/CodeIgniter4-Standard/CodeIgniter4/ruleset.xml'
or if globally installed.
phpcs /Path/To/MyProject --standard=CodeIgniter4
Single file.
phpcbf /Path/To/MyFile.php --standard='/Path/To/CodeIgniter4-Standard/CodeIgniter4/ruleset.xml'
or if globally installed.
phpcbf /Path/To/MyFile.php --standard=CodeIgniter4
Directory (recursive).
phpcbf /Path/To/MyProject --standard='/Path/To/CodeIgniter4-Standard/CodeIgniter4/ruleset.xml'
or if globally installed.
phpcbf /Path/To/MyProject --standard=CodeIgniter4
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 toSquiz Labs for creatingPHP_CodeSniffer.
Thanks toEllisLab for originally creating CodeIgniter and theBritish Columbia Institute of Technology for continuing the project. Thanks to all the developers and contibutors working onCodeIgniter 4.
About
DEPRECATED! CodeIgniter 4 Coding Standard for PHP_CodeSniffer 3.
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors8
Uh oh!
There was an error while loading.Please reload this page.