File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -16,20 +16,21 @@ composer require --dev laravel-fans/lint
16
16
php artisan lint:publish
17
17
```
18
18
19
- ## use
19
+ ## usage
20
20
21
- lint code:
21
+ ### lint code
22
22
23
23
``` shell
24
- php artisan lint:check .
25
- php artisan lint:check app/ tests/
26
- php artisan lint:check --standard=Squiz app/
24
+ php artisan lint:code
25
+ php artisan lint:code --fix
26
+ php artisan lint:code app/ tests/
27
+ php artisan lint:code --standard=Squiz app/
27
28
php artisan lint:staged
28
29
```
29
30
30
- The default standard is PSR-12 , feel free to change the ` phpcs.xml ` .
31
+ The default standard is ` phpcs.xml ` , feel free to change it .
31
32
32
- lint route URL:
33
+ ### lint route URI
33
34
34
35
``` shell
35
36
php artisan lint:route
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class LintCodeCommand extends Command
14
14
* @var string
15
15
*/
16
16
protected $ signature = 'lint:code
17
- {files*}
17
+ {files? *}
18
18
{--fix : automatic fix}
19
19
{--standard=phpcs.xml : coding standards} ' ;
20
20
@@ -33,9 +33,11 @@ class LintCodeCommand extends Command
33
33
public function handle ()
34
34
{
35
35
$ bin = $ this ->option ('fix ' ) ? 'phpcbf ' : 'phpcs ' ;
36
+ $ files = empty ($ this ->argument ('files ' )) ? [ '. ' ] : $ this ->argument ('files ' );
37
+
36
38
exec (
37
39
"vendor/bin/ $ bin --standard= " . $ this ->option ('standard ' )
38
- . ' ' . implode (' ' , $ this -> argument ( ' files ' ) ),
40
+ . ' ' . implode (' ' , $ files ),
39
41
$ output ,
40
42
$ code
41
43
);
You can’t perform that action at this time.
0 commit comments