Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rebuy-de/php-cs
PHP Coding style configuration for reBuy projects
https://github.com/rebuy-de/php-cs
Last synced: about 1 month ago
JSON representation
PHP Coding style configuration for reBuy projects
- Host: GitHub
- URL: https://github.com/rebuy-de/php-cs
- Owner: rebuy-de
- License: mit
- Created: 2017-01-17T11:27:24.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-17T15:24:07.000Z (almost 8 years ago)
- Last Synced: 2024-04-15T22:59:19.309Z (8 months ago)
- Language: PHP
- Size: 2.93 KB
- Stars: 0
- Watchers: 31
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-cs
The file [.php_cs.dist](.php_cs.dist) contains all rules which apply to the coding standards for rebuy. You can find the description of these rules in the [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/README.rst) repository.
## Examples
### Travis code style check
```bash
vendor/bin/php-cs-fixer fix --config=vendor/rebuy/php-cs/.php_cs.dist -v --dry-run --using-cache=no `git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE`
```**Note:** If you define the path in your own `.php_cs.dist` file, you might want use `--path-mode intersection`.
### Fixing code styles
```bash
vendor/bin/php-cs-fixer fix --config=vendor/rebuy/php-cs/.php_cs.dist yourDirectory/`
```### Fixing code styles from $yourBranch to master
```bash
vendor/bin/php-cs-fixer fix --config=.php_cs.dist `git diff --name-only --diff-filter=ACMRTUXB master`
```## Overwriting rules
There might be some scenarios where you have to adjust the rules defined here, in this case you can include the base file and extend it to your needs:
```php
getRules();
$newRules = [
'phpdoc_no_empty_return' => false,
];$config->setRules(array_merge($currentRules, $newRules));
```