Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dotsunited/php-cs-fixer-config
Configurations for friendsofphp/php-cs-fixer used by @dotsunited.
https://github.com/dotsunited/php-cs-fixer-config
Last synced: about 20 hours ago
JSON representation
Configurations for friendsofphp/php-cs-fixer used by @dotsunited.
- Host: GitHub
- URL: https://github.com/dotsunited/php-cs-fixer-config
- Owner: dotsunited
- License: mit
- Created: 2017-11-20T12:47:23.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-01-20T14:28:05.000Z (almost 5 years ago)
- Last Synced: 2024-11-04T19:52:53.930Z (13 days ago)
- Language: PHP
- Homepage:
- Size: 35.2 KB
- Stars: 1
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
php-cs-fixer-config
===================[![Build Status](https://travis-ci.org/dotsunited/php-cs-fixer-config.svg?branch=master)](https://travis-ci.org/dotsunited/php-cs-fixer-config)
Configurations for [`friendsofphp/php-cs-fixer`](http://github.com/FriendsOfPHP/PHP-CS-Fixer)
used by Dots United.## Installation
```
$ composer require --dev dotsunited/php-cs-fixer-config
```## Usage
### Pick a configuration
The following configurations are available:
* `DotsUnited\PhpCsFixer\Php56Config`
* `DotsUnited\PhpCsFixer\Php71Config`### Configuration
Create a configuration file `.php_cs` in the root of your project:
```php
getFinder()
->in(__DIR__);$cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__;
$config
->setCacheFile($cacheDir . '/.php_cs.cache');return $config;
```### Git
Add `.php_cs.cache` (this is the cache file created by `php-cs-fixer`) to `.gitignore`:
```
.php_cs.cache
```### Travis
Update your `.travis.yml` to cache the `.php_cs.cache` file:
```yml
cache:
directories:
- $HOME/.php-cs-fixer
```Then run `php-cs-fixer` in the `script` section:
```yml
script:
- vendor/bin/php-cs-fixer fix --verbose --diff --dry-run
```### Gitlab
Update your `.gitlab-ci.yml` to cache the `.php_cs.cache` file:
```yml
cache:
paths:
- .php-cs-fixer
```Then run `php-cs-fixer` in the `script` section:
```yml
test:
script:
- vendor/bin/php-cs-fixer fix --verbose --diff --dry-run
```## Credits
This package is based off
[`refinery29/php-cs-fixer-config`](https://github.com/refinery29/php-cs-fixer-config/).License
-------Copyright (c) 2017-2018 Dots United GmbH.
Released under the [MIT](LICENSE) license.