https://github.com/ubc/ctlt-php-coding-standard
UBC CTLT PHP coding standard
https://github.com/ubc/ctlt-php-coding-standard
Last synced: 3 months ago
JSON representation
UBC CTLT PHP coding standard
- Host: GitHub
- URL: https://github.com/ubc/ctlt-php-coding-standard
- Owner: ubc
- Created: 2012-02-25T00:35:35.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2014-07-29T00:38:20.000Z (almost 12 years ago)
- Last Synced: 2025-01-21T21:44:55.258Z (over 1 year ago)
- Homepage:
- Size: 148 KB
- Stars: 1
- Watchers: 29
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
CTLT PHP CodeSniffer Coding Standard
========================================
A code standard based on [Symfony 2 coding standards](http://symfony.com/doc/current/contributing/code/standards.html).
Installation (Composer)
-----------------------
1. [Install composer](https://getcomposer.org/download/)
2. Add the dependency to composer.json:
```json
{
"require-dev": {
"ubc/ctlt-coding-standard": "~1.0",
}
}
```
3. Install dependencies
composer update
4. Use it
phpcs --standard=vendor/ubc/ctlt-coding-standard/ruleset.xml --runtime-set installed_paths vendor/m6web/symfony2-coding-standard src/*
Or add the following Phing task:
Installation (Pear)
-------------------
1. Install phpcs:
pear install PHP_CodeSniffer
2. Find your PEAR directory:
pear config-show | grep php_dir
3. Copy, symlink or check out this repo and Symfony2 coding standard to the
phpcs `Standards` directory:
cd /path/to/pear/PHP/CodeSniffer/Standards
git clone git://github.com/opensky/Symfony2-coding-standard.git Symfony2
git clone git://github.com/ubc/CTLT-PHP-coding-standard.git CTLT
4. Set CTLT as your default coding standard:
phpcs --config-set default_standard CTLT
5. ...
6. Profit!
cd /path/to/my/project
phpcs
phpcs path/to/my/file.php