Skip to content

Commit b480a9e

Browse files
committed
Make php-cs-fixer work in phpstorm
1 parent 91cdf08 commit b480a9e

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: install dependencies
5252
run: composer install --prefer-dist --no-interaction --no-progress
5353
- name: run cs-fixer
54-
run: vendor/bin/php-cs-fixer fix --dry-run --diff --diff-format=udiff
54+
run: vendor/bin/php-cs-fixer fix --dry-run --diff --diff-format=udiff --rules=psr_autoloading
5555
continue-on-error: true
5656
- name: execute unit tests
5757
run: vendor/bin/phpunit --bootstrap bootstrap/app.php tests/Unit

.php_cs.dist

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
use PhpCsFixer\Config;
44
use PhpCsFixer\Finder;
55

6-
$finder = (new Finder)->in(__DIR__)->exclude(['vendor', 'node_modules', 'storage']);
6+
$finder = (new Finder())->in(__DIR__)->exclude(['vendor', 'node_modules', 'storage', 'bootstrap/cache']);
77

8-
return (new Config)
8+
return (new Config())
99
->setRiskyAllowed(true)
1010
->setFinder($finder)
1111
->setRules([
@@ -23,8 +23,6 @@ return (new Config)
2323
'ordered_imports' => [
2424
'sortAlgorithm' => 'length',
2525
],
26-
'psr0' => ['dir' => 'app'],
27-
'psr4' => true,
2826
'random_api_migration' => true,
2927
'ternary_to_null_coalescing' => true,
3028
'yoda_style' => [

app/Http/Controllers/Admin/Settings/IndexController.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ public function __construct(
4444
Kernel $kernel,
4545
SettingsRepositoryInterface $settings,
4646
SoftwareVersionService $versionService
47-
)
48-
{
47+
) {
4948
$this->alert = $alert;
5049
$this->kernel = $kernel;
5150
$this->settings = $settings;

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
}
6969
},
7070
"scripts": {
71-
"php-cs-fixer": "php-cs-fixer fix --diff --diff-format=udiff --config=./.php_cs.dist",
71+
"php-cs-fixer": "php-cs-fixer fix --diff --diff-format=udiff --config=./.php_cs.dist --rules=psr_autoloading",
7272
"post-root-package-install": [
7373
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
7474
],

0 commit comments

Comments
 (0)