https://github.com/bgaze/laravel-php-cs-fixer
A PHP-CS-Fixer bridge for Laravel 5.5+
https://github.com/bgaze/laravel-php-cs-fixer
beautify-php fix-php laravel php-cs-fixer
Last synced: about 1 year ago
JSON representation
A PHP-CS-Fixer bridge for Laravel 5.5+
- Host: GitHub
- URL: https://github.com/bgaze/laravel-php-cs-fixer
- Owner: bgaze
- License: mit
- Created: 2018-05-14T09:01:41.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-06-01T03:58:26.000Z (about 6 years ago)
- Last Synced: 2025-03-24T15:47:34.002Z (about 1 year ago)
- Topics: beautify-php, fix-php, laravel, php-cs-fixer
- Language: PHP
- Homepage: https://packages.bgaze.fr/laravel-php-cs-fixer
- Size: 35.2 KB
- Stars: 13
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP CS Fixer for Laravel 5.5+
[](https://github.com/bgaze/laravel-php-cs-fixer/blob/master/LICENSE)

[](https://github.com/bgaze/laravel-php-cs-fixer/releases)
[](https://github.com/bgaze/laravel-php-cs-fixer/stargazers)
[](https://packagist.org/packages/bgaze/laravel-php-cs-fixer)
This package allows to use [PHP-CS-Fixer](https://cs.sensiolabs.org/) right into Laravel 5.5+ applications
to format PHP code.
# Documentation
Full documentation is available at [https://packages.bgaze.fr/laravel-php-cs-fixer](https://packages.bgaze.fr/laravel-php-cs-fixer)
# Quick start
Install this package using [Composer](https://getcomposer.org).
```
$ composer require bgaze/laravel-php-cs-fixer
```
To customize the configuration, publish it:
```
$ php artisan vendor:publish --tag=bgaze-php-cs-fixer-config
```
> **Notes :** Configuration returns an instance of `\PhpCsFixer\Config` and will be published into a `.php_cs.dist` file at the Laravel installation root.
Use `php-cs-fixer:fix` artisan command to fix files in your application:
```
$ php-cs-fixer:fix [options] path1 [path2 path3 ...]
```
Use `php_cs_fixer()` helper to fix files from the code:
```php
// Quick.
php_cs_fixer('path/to/a/file/or/dir');
// Advanced.
php_cs_fixer(['path/to/file/or/dir/1', 'path/to/file/or/dir/2'], [
'--allow-risky' => true,
'--dry-run' => true,
'--config' => 'path/to/a/config/file'
]);
```