Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
xalopp authored and mmoll committed Nov 19, 2017
1 parent c53298b commit bdc31f5
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 27 deletions.
21 changes: 8 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,24 @@
We do recommend the following setup:

* make sure that [Composer](https://getcomposer.org) is installed
* clone the [PHP_CodeSniffer repository](https://github.com/squizlabs/PHP_CodeSniffer)
* run `composer install` inside the `PHP_CodeSniffer` directory to install required dependencies
* get the [Symfony Coding Standard](https://github.com/djoos/Symfony-coding-standard) and symlink, copy or move its `Symfony` subdirectory to `PHP_CodeSniffer/src/Standards/Symfony`
* symlink, copy or clone this repository to `PHP_CodeSniffer/src/Standards/MO4`
* clone this repository

git clone https://github.com/mayflower/mo4-coding-standard.git

* install all required dependencies

git clone https://github.com/squizlabs/PHP_CodeSniffer.git
cd PHP_CodeSniffer
composer install
cd src/Standards
git clone https://github.com/djoos/Symfony-coding-standard.git Symfony
mv Symfony/Symfony/* Symfony/
git clone https://github.com/mayflower/mo4-coding-standard.git MO4


## Coding Standard and Tests

If you contribute code, please make sure it conforms to the PHPCS coding standard and that the unit tests still pass.

1. To check the coding standard, run in the repository root of `PHP_CodeSniffer`:
1. To check the coding standard, execute in the repository root:

./bin/phpcs --ignore='*/vendor/*' src/Standards/MO4
./vendor/bin/phpcs MO4

2. The unit-tests are run from within the `PHP_CodeSniffer` directory
2. To run the unit tests, execute in the repository root:

./vendor/bin/phpunit --filter MO4

74 changes: 60 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,37 +26,83 @@ The MO4 Coding Standard is an extension of the [Symfony Coding Standard](http://

## Installation

1. Install phpcs:
### Composer

pear install PHP_CodeSniffer
Using [Composer](https://getcomposer.org/) is the preferred way.

1. Add the MO4 repository

composer config repositories.mo4 vcs https://github.com/mayflower/mo4-coding-standard.git

If composer complains about a missing composer.json, just create an empty one

echo '{}' > composer.json

2. Add the MO4 coding standard to `composer.json`

composer require --dev mayflower/mo4-coding-standard:dev-master

3. Profit

./vendor/bin/phpcs --standard=MO4 path/to/my/file.php

4. Optionally, you might set MO4 as default coding standard

./vendor/bin/phpcs --config-set default_standard MO4

### Source

1. Checkout this repository

git clone https://github.com/mayflower/mo4-coding-standard.git

2. Install dependencies

2. Find your PEAR directory:
composer install

pear config-show | grep php_dir
3. Check, that Symfony and MO4 are listed as coding standards

3. Copy, symlink or check out the Symfony coding standard and this repository to their respecting folders inside the
phpcs `Standards` directory:
./vendor/bin/phpcs -i

cd /path/to/pear/PHP/CodeSniffer/src/Standards
git clone https://github.com/djoos/Symfony-coding-standard.git Symfony
mv Symfony/Symfony/* Symfony/
git clone https://github.com/mayflower/mo4-coding-standard.git MO4
4. Profit

4. Select the MO4 ruleset as your default coding standard:
./vendor/bin/phpcs --standard=MO4 path/to/my/file.php

5. Optionally, you might set MO4 as default coding standard

./vendor/bin/phpcs --config-set default_standard MO4


### Pear

1. Install phpcs

pear install PHP_CodeSniffer

2. Check out the Symfony coding standard and this repository

git clone https://github.com/djoos/symfony-coding-standard.git
git clone https://github.com/mayflower/mo4-coding-standard.git

3. Select the MO4 ruleset as your default coding standard

phpcs --config-set installed_paths PATH/TO/symfony2-coding-standard,PATH/TO/mo4-coding-standard
phpcs --config-set default_standard MO4

5. Profit
4. Profit

phpcs --standard=MO4 path/to/my/file.php

phpcs path/to/my/file.php
5. Optionally, you might set MO4 as default coding standard

phpcs --config-set default_standard MO4

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for information.

## Credit


## License

This project is licensed under the MIT license.

0 comments on commit bdc31f5

Please sign in to comment.