Skip to content

Commit abe23c1

Browse files
committed
Update the Readme
1 parent 1ceac73 commit abe23c1

File tree

2 files changed

+29
-106
lines changed

2 files changed

+29
-106
lines changed

README.md

Lines changed: 27 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -19,93 +19,23 @@ do all the other laravel packages you use.
1919

2020
## Versions and compatibility
2121
> **Note:** This documentation was written for Laravel 5.5.
22-
* PHP Version: ">=7.0"
23-
* Laravel/Lumen: "^5.4|^6.0"
24-
* PHP-CS-Fixer: "2.14.*"
22+
* PHP Version: "^7.1.3 || ^8.0"
23+
* Laravel/Lumen: "^5.4|^6.0|^7.0|^8.0"
24+
* PHP-CS-Fixer: "^3.0.0"
2525

2626
## Installation
2727

2828
```
2929
composer require stechstudio/laravel-php-cs-fixer
3030
```
3131

32-
> **Note**: If you are using Laravel 5.5 or greater, no need to register the provider. Laravel PHP CS Fixer supports Laravel new [Package Discovery](https://laravel.com/docs/5.5/packages#package-discovery).
33-
34-
### Manually Register the Provider for Laravel 5.4:
35-
36-
#### Laravel
37-
Add the following to the `providers` array in `config/app.php`.:
38-
39-
```php
40-
STS\Fixer\FixerServiceProvider::class,
41-
```
42-
43-
#### Lumen
44-
Add the following to `bootstrap/app.php`.:
45-
46-
```php
47-
$app->register(STS\Fixer\FixerServiceProvider::class);
48-
```
49-
5032
## Configuration
51-
The default rule configuration is in the `fixer.php` and is intended to match the rules used by the Laravel Framework.
52-
53-
```php
54-
return [
55-
'rules' => [
56-
'psr0' => false,
57-
'@PSR2' => true,
58-
'blank_line_after_namespace' => true,
59-
'braces' => true,
60-
'class_definition' => true,
61-
'elseif' => true,
62-
'function_declaration' => true,
63-
'indentation_type' => true,
64-
'line_ending' => true,
65-
'lowercase_constants' => true,
66-
'lowercase_keywords' => true,
67-
'method_argument_space' => [
68-
'ensure_fully_multiline' => true, ],
69-
'no_break_comment' => true,
70-
'no_closing_tag' => true,
71-
'no_spaces_after_function_name' => true,
72-
'no_spaces_inside_parenthesis' => true,
73-
'no_trailing_whitespace' => true,
74-
'no_trailing_whitespace_in_comment' => true,
75-
'single_blank_line_at_eof' => true,
76-
'single_class_element_per_statement' => [
77-
'elements' => ['property'],
78-
],
79-
'single_import_per_statement' => true,
80-
'single_line_after_imports' => true,
81-
'switch_case_semicolon_to_colon' => true,
82-
'switch_case_space' => true,
83-
'visibility_required' => true,
84-
'encoding' => true,
85-
'full_opening_tag' => true,
86-
],
87-
];
88-
```
33+
The default rule configuration is in the [fixer.php](https://github.com/stechstudio/Laravel-PHP-CS-Fixer/blob/master/config/fixer.php) and is intended to match the rules used by Laravel Shift.
8934

9035
if you want to modify this yourself, just use artisan `php artisan vendor:publish --provider="STS\Fixer\FixerServiceProvider"`
9136
and it will put the default configuration in 'config/fixer.php'. Check the
9237
[PHP-CS-Fixer/README](https://github.com/FriendsOfPHP/PHP-CS-Fixer#usage) for valid rules.
9338

94-
> Note: There are some static configuration settings in the finder that have yet to be moved to the configuration file
95-
> that you should be aware of! We plan to move these to the config file soon.
96-
97-
```php
98-
$finder = Finder::create()
99-
->notPath('bootstrap/cache')
100-
->notPath('storage')
101-
->notPath('vendor')
102-
->in(base_path())
103-
->name('*.php')
104-
->notName('*.blade.php')
105-
->ignoreDotFiles(true)
106-
->ignoreVCS(true);
107-
```
108-
10939
## Usage
11040
#### Fix Your Code
11141
Fix your code with Laravel Coding Standards.
@@ -118,37 +48,30 @@ $ php artisan fixer:fix [options]
11848
Example:
11949
```
12050
Usage:
121-
fixer:fix [options]
51+
fixer:fix [options] [--] [<path>...]
52+
53+
Arguments:
54+
path The path. Can be a list of space separated paths
12255
12356
Options:
124-
--path[=PATH] The path. (multiple values allowed)
125-
--path-mode[=PATH-MODE] Specify path mode (can be override or intersection). [default: "override"]
126-
--allow-risky[=ALLOW-RISKY] Are risky fixers allowed (can be yes or no).
127-
--config[=CONFIG] The path to a .php_cs file.
128-
--dry-run Only shows which files would have been modified.
129-
--rules[=RULES] The Rules
130-
--using-cache[=USING-CACHE] Does cache should be used (can be yes or no). [default: "yes"]
131-
--cache-file[=CACHE-FILE] The path to the cache file.
132-
--diff Also produce diff for each file.
133-
--diff-format[=DIFF-FORMAT] Specify diff format.
134-
--format[=FORMAT] To output results in other formats.
135-
--stop-on-violation Stop execution on first violation.
136-
--show-progress[=SHOW-PROGRESS] Type of progress indicator (none, run-in, estimating or estimating-max).
137-
-h, --help Display this help message
138-
-q, --quiet Do not output any message
139-
-V, --version Display this application version
140-
--ansi Force ANSI output
141-
--no-ansi Disable ANSI output
142-
-n, --no-interaction Do not ask any interactive question
143-
--env[=ENV] The environment the command should run under
144-
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
57+
--path-mode=PATH-MODE Specify path mode (can be override or intersection). [default: "override"]
58+
--allow-risky=ALLOW-RISKY Are risky fixers allowed (can be yes or no).
59+
--config=CONFIG The path to a .php-cs-fixer.php file.
60+
--dry-run Only shows which files would have been modified.
61+
--rules=RULES The rules.
62+
--using-cache=USING-CACHE Does cache should be used (can be yes or no).
63+
--cache-file=CACHE-FILE The path to the cache file.
64+
--diff Also produce diff for each file.
65+
--format=FORMAT To output results in other formats.
66+
--stop-on-violation Stop execution on first violation.
67+
--show-progress=SHOW-PROGRESS Type of progress indicator (none, dots).
68+
-h, --help Display help for the given command. When no command is given display help for the list command
69+
-q, --quiet Do not output any message
70+
-V, --version Display this application version
71+
--ansi Force ANSI output
72+
--no-ansi Disable ANSI output
73+
-n, --no-interaction Do not ask any interactive question
74+
--env[=ENV] The environment the command should run under
75+
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
14576
146-
// Only shows which files would have been modified
147-
$ php artisan fixer:fix --dry-run
148-
149-
// Modify the files that need to be fixed
150-
$ php artisan fixer:fix
151-
152-
// Check all the files in the `app` directory
153-
$ php artisan fixer:fix --path app --dry-run
15477
```

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
{
2525
"name": "Bubba Hines",
2626
"email": "rob@stechstudio.com"
27-
}
27+
}
2828
],
2929
"require": {
30-
"php": ">=7.0",
30+
"php": "^7.1.3 || ^8.0",
3131
"illuminate/support": "^5.4|^6.0|^7.0|^8.0",
3232
"friendsofphp/php-cs-fixer": "^3.0.0"
3333
},

0 commit comments

Comments
 (0)