-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f790e4
commit 267cc45
Showing
1 changed file
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,32 @@ | ||
# phpcsfixer-config | ||
# phpcsfixer-config | ||
|
||
### Install | ||
|
||
``` | ||
composer require --dev josephscott/phpcsfixer-config | ||
``` | ||
|
||
Create a `.php-cs-fixer.dist.php` in the top level directory of your | ||
repo with: | ||
|
||
``` | ||
<?php | ||
declare( strict_types = 1 ); | ||
require __DIR__ . '/vendor/autoload.php'; | ||
$fixer_config = new JosephScott\PHPCSFixer_Config( __DIR__ ); | ||
return $fixer_config->get_config(); | ||
``` | ||
|
||
If you want to make alterations, all of the rules and options are available | ||
via public attributes on the `JosephScott\PHPCSFixer_Config()` object. Here | ||
is how you would alter the `array_indention` rule and the indent config | ||
option: | ||
|
||
``` | ||
$fixer_config = new JosephScott\PHPCSFixer_Config( __DIR__ ); | ||
$fixer_config->config_indent = ' '; | ||
$fixer_config->rules['array_indention'] = false; | ||
return $fixer_config->get_config(); | ||
``` |