Skip to content

Commit

Permalink
Upgraded friendsofphp/php-cs-fixer to ^3.22 (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
divya-intelli authored Aug 9, 2023
1 parent 05f98cc commit 200301e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/*.php
/*.xml
/*.log
!/.php_cs.dist
!/.php-cs-fixer.dist.php
!/psalm.xml.dist
!/phpunit.xml.dist
/vendor
Expand Down
14 changes: 10 additions & 4 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,25 @@
* added to the repo.
* @todo: Add a copyright validation (https://github.com/apigee/apigee-client-php/issues/81).
*/
return PhpCsFixer\Config::create()
$config = new PhpCsFixer\Config();

$config
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'class_definition' => ['singleLine' => false, 'singleItemSingleLine' => true],
'class_definition' => ['single_line' => false, 'single_item_single_line' => true],
'concat_space' => ['spacing' => 'one'],
'general_phpdoc_annotation_remove' => ['author'],
'general_phpdoc_annotation_remove' => ['annotations' => ['author']],
'ordered_class_elements' => true,
'ordered_imports' => true,
'phpdoc_align' => false,
'phpdoc_annotation_without_dot' => false,
'phpdoc_indent' => false,
'phpdoc_inline_tag' => false,
'general_phpdoc_tag_rename' => false,
'phpdoc_inline_tag_normalizer' => false,
'phpdoc_tag_type' => false,
'phpdoc_order' => true,
// Disabled because fluent setters return type in an interface can not be self.
'self_accessor' => false,
Expand All @@ -36,3 +40,5 @@
'single_line_throw' => false,
])
->setFinder($finder);

return $config;
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"require-dev": {
"dms/phpunit-arraysubset-asserts": "^0.4.0",
"friendsofphp/php-cs-fixer": "^2.19",
"friendsofphp/php-cs-fixer": "^3.22",
"fzaninotto/faker": "^1.7",
"guzzlehttp/psr7": "^2.5",
"league/flysystem": "^1.0",
Expand Down Expand Up @@ -78,8 +78,8 @@
"analyze": "vendor/vimeo/psalm/psalm --config=psalm.xml.dist --show-info=false --stats",
"metrics": "vendor/bin/phpmetrics .",
"metrics-html": "vendor/bin/phpmetrics . --report-html=report",
"check-style": "vendor/bin/php-cs-fixer fix --config=./.php_cs.dist --verbose --dry-run",
"fix-style": "vendor/bin/php-cs-fixer fix --config=./.php_cs.dist"
"check-style": "vendor/bin/php-cs-fixer fix --config=./.php-cs-fixer.dist.php --verbose --dry-run",
"fix-style": "vendor/bin/php-cs-fixer fix --config=./.php-cs-fixer.dist.php"
},
"extra": {
"branch-alias": {
Expand Down

0 comments on commit 200301e

Please sign in to comment.