Make php-cs-fixer work in phpstorm
This commit is contained in:
parent
91cdf08489
commit
b480a9e4e2
4 changed files with 5 additions and 8 deletions
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
|
@ -51,7 +51,7 @@ jobs:
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
run: composer install --prefer-dist --no-interaction --no-progress
|
run: composer install --prefer-dist --no-interaction --no-progress
|
||||||
- name: run cs-fixer
|
- name: run cs-fixer
|
||||||
run: vendor/bin/php-cs-fixer fix --dry-run --diff --diff-format=udiff
|
run: vendor/bin/php-cs-fixer fix --dry-run --diff --diff-format=udiff --rules=psr_autoloading
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: execute unit tests
|
- name: execute unit tests
|
||||||
run: vendor/bin/phpunit --bootstrap bootstrap/app.php tests/Unit
|
run: vendor/bin/phpunit --bootstrap bootstrap/app.php tests/Unit
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
use PhpCsFixer\Config;
|
use PhpCsFixer\Config;
|
||||||
use PhpCsFixer\Finder;
|
use PhpCsFixer\Finder;
|
||||||
|
|
||||||
$finder = (new Finder)->in(__DIR__)->exclude(['vendor', 'node_modules', 'storage']);
|
$finder = (new Finder())->in(__DIR__)->exclude(['vendor', 'node_modules', 'storage', 'bootstrap/cache']);
|
||||||
|
|
||||||
return (new Config)
|
return (new Config())
|
||||||
->setRiskyAllowed(true)
|
->setRiskyAllowed(true)
|
||||||
->setFinder($finder)
|
->setFinder($finder)
|
||||||
->setRules([
|
->setRules([
|
||||||
|
@ -23,8 +23,6 @@ return (new Config)
|
||||||
'ordered_imports' => [
|
'ordered_imports' => [
|
||||||
'sortAlgorithm' => 'length',
|
'sortAlgorithm' => 'length',
|
||||||
],
|
],
|
||||||
'psr0' => ['dir' => 'app'],
|
|
||||||
'psr4' => true,
|
|
||||||
'random_api_migration' => true,
|
'random_api_migration' => true,
|
||||||
'ternary_to_null_coalescing' => true,
|
'ternary_to_null_coalescing' => true,
|
||||||
'yoda_style' => [
|
'yoda_style' => [
|
||||||
|
|
|
@ -44,8 +44,7 @@ class IndexController extends Controller
|
||||||
Kernel $kernel,
|
Kernel $kernel,
|
||||||
SettingsRepositoryInterface $settings,
|
SettingsRepositoryInterface $settings,
|
||||||
SoftwareVersionService $versionService
|
SoftwareVersionService $versionService
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
$this->alert = $alert;
|
$this->alert = $alert;
|
||||||
$this->kernel = $kernel;
|
$this->kernel = $kernel;
|
||||||
$this->settings = $settings;
|
$this->settings = $settings;
|
||||||
|
|
|
@ -68,7 +68,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"php-cs-fixer": "php-cs-fixer fix --diff --diff-format=udiff --config=./.php_cs.dist",
|
"php-cs-fixer": "php-cs-fixer fix --diff --diff-format=udiff --config=./.php_cs.dist --rules=psr_autoloading",
|
||||||
"post-root-package-install": [
|
"post-root-package-install": [
|
||||||
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in a new issue