Fix fn spacing rule, upgrade to the latest PHP-CS-Fixer and add a new rule

This commit is contained in:
ErickSkrauch 2022-12-06 22:15:12 +01:00
parent 2db4af0180
commit 251ebc529c
No known key found for this signature in database
GPG Key ID: 669339FCBB30EE0E
4 changed files with 16 additions and 13 deletions

View File

@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- `semicolon_after_instruction` fixer. - `semicolon_after_instruction` fixer.
- `types_spaces` fixer. - `types_spaces` fixer.
- `no_trailing_comma_in_singleline` fixer. - `no_trailing_comma_in_singleline` fixer.
- `no_useless_concat_operator` fixer.
### Changed ### Changed
- `friendsofphp/php-cs-fixer` version bumped to `^3`. - `friendsofphp/php-cs-fixer` version bumped to `^3`.

View File

@ -20,7 +20,7 @@
"homepage": "https://github.com/elyby/php-code-style", "homepage": "https://github.com/elyby/php-code-style",
"require": { "require": {
"php": "^7.4 || ^8.0", "php": "^7.4 || ^8.0",
"friendsofphp/php-cs-fixer": "^3.11" "friendsofphp/php-cs-fixer": "^3.13"
}, },
"require-dev": { "require-dev": {
"ergebnis/composer-normalize": "^2.28", "ergebnis/composer-normalize": "^2.28",

24
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "607064616a9a1792ffcb571b67dabb7f", "content-hash": "984ffa466fb6bc9281a36b8701147fee",
"packages": [ "packages": [
{ {
"name": "composer/pcre", "name": "composer/pcre",
@ -375,16 +375,16 @@
}, },
{ {
"name": "friendsofphp/php-cs-fixer", "name": "friendsofphp/php-cs-fixer",
"version": "v3.11.0", "version": "v3.13.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "7dcdea3f2f5f473464e835be9be55283ff8cfdc3" "reference": "a6232229a8309e8811dc751c28b91cb34b2943e1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/7dcdea3f2f5f473464e835be9be55283ff8cfdc3", "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/a6232229a8309e8811dc751c28b91cb34b2943e1",
"reference": "7dcdea3f2f5f473464e835be9be55283ff8cfdc3", "reference": "a6232229a8309e8811dc751c28b91cb34b2943e1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -408,7 +408,7 @@
}, },
"require-dev": { "require-dev": {
"justinrainbow/json-schema": "^5.2", "justinrainbow/json-schema": "^5.2",
"keradus/cli-executor": "^1.5", "keradus/cli-executor": "^2.0",
"mikey179/vfsstream": "^1.6.10", "mikey179/vfsstream": "^1.6.10",
"php-coveralls/php-coveralls": "^2.5.2", "php-coveralls/php-coveralls": "^2.5.2",
"php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/accessible-object": "^1.1",
@ -417,8 +417,8 @@
"phpspec/prophecy": "^1.15", "phpspec/prophecy": "^1.15",
"phpspec/prophecy-phpunit": "^2.0", "phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.5", "phpunit/phpunit": "^9.5",
"phpunitgoodpractices/polyfill": "^1.5", "phpunitgoodpractices/polyfill": "^1.6",
"phpunitgoodpractices/traits": "^1.9.1", "phpunitgoodpractices/traits": "^1.9.2",
"symfony/phpunit-bridge": "^6.0", "symfony/phpunit-bridge": "^6.0",
"symfony/yaml": "^5.4 || ^6.0" "symfony/yaml": "^5.4 || ^6.0"
}, },
@ -451,8 +451,8 @@
], ],
"description": "A tool to automatically fix PHP code style", "description": "A tool to automatically fix PHP code style",
"support": { "support": {
"issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
"source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.11.0" "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.13.0"
}, },
"funding": [ "funding": [
{ {
@ -460,7 +460,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2022-09-01T18:24:51+00:00" "time": "2022-10-31T19:28:50+00:00"
}, },
{ {
"name": "psr/cache", "name": "psr/cache",

View File

@ -110,6 +110,7 @@ class Rules {
'combine_nested_dirname' => true, 'combine_nested_dirname' => true,
'function_declaration' => [ 'function_declaration' => [
'closure_function_spacing' => 'none', 'closure_function_spacing' => 'none',
'closure_fn_spacing' => 'none',
], ],
'function_typehint_space' => true, 'function_typehint_space' => true,
'implode_call' => true, 'implode_call' => true,
@ -153,6 +154,7 @@ class Rules {
'new_with_braces' => [ 'new_with_braces' => [
'anonymous_class' => false, 'anonymous_class' => false,
], ],
'no_useless_concat_operator' => true,
'no_useless_nullsafe_operator' => true, 'no_useless_nullsafe_operator' => true,
'object_operator_without_whitespace' => true, 'object_operator_without_whitespace' => true,
'operator_linebreak' => true, 'operator_linebreak' => true,