Skip to content

Commit

Permalink
Update php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Nov 13, 2021
1 parent 058c5aa commit a0522c6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Code stuff
vendor
composer.lock
.php_cs.cache
.php-cs-fixer.cache
_meta
.phpunit.result.cache

Expand Down
24 changes: 12 additions & 12 deletions .php_cs → .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
$rules = [
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => ['align_double_arrow' => true, 'align_equals' => false],
'binary_operator_spaces' => ['operators' => ['=>' => 'align', '=' => 'single_space']],
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_return' => true,
'blank_line_before_statement' => ['statements' => ['return']],
'braces' => true,
'cast_spaces' => true,
'class_definition' => true,
Expand All @@ -22,16 +22,15 @@
'full_opening_tag' => true,
'function_declaration' => true,
'function_typehint_space' => true,
'hash_to_slash_comment' => true,
'single_line_comment_style' => ['comment_types' => ['hash']],
'heredoc_to_nowdoc' => true,
'include' => true,
'indentation_type' => true,
'line_ending' => true,
'lowercase_cast' => true,
'lowercase_constants' => true,
'constant_case' => ['case' => 'lower'],
'lowercase_keywords' => true,
'method_argument_space' => true,
'method_separation' => true,
'multiline_whitespace_before_semicolons' => true,
'native_function_casing' => true,
'new_with_braces' => true,
Expand Down Expand Up @@ -63,19 +62,21 @@
'no_whitespace_in_blank_line' => true,
'normalize_index_brace' => true,
'object_operator_without_whitespace' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'phpdoc_align' => true,
'phpdoc_indent' => true,
'phpdoc_inline_tag' => true,
'general_phpdoc_tag_rename' => true,
'phpdoc_inline_tag_normalizer' => true,
'phpdoc_tag_type' => ['tags' => ['inheritdoc' => 'inline']],
'phpdoc_no_empty_return' => true,
'phpdoc_no_access' => true,
'phpdoc_no_alias_tag' => ['type' => 'var'],
'phpdoc_no_package' => true,
'phpdoc_order' => true,
'phpdoc_scalar' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_trim' => true,
'phpdoc_types' => true,
'psr4' => true,
'psr_autoloading' => true,
'short_scalar_cast' => true,
'simplified_null_return' => true,
'single_blank_line_at_eof' => true,
Expand All @@ -102,9 +103,8 @@
$finder = PhpCsFixer\Finder::create()
->in([__DIR__ . '/src', __DIR__ . '/tests']);

return PhpCsFixer\Config::create()
->setRules($rules)
$config = new PhpCsFixer\Config();
return $config->setRules($rules)
->setFinder($finder)
->setUsingCache(true)
->setCacheFile(__DIR__.'/.php_cs.cache')
->setRiskyAllowed(true);
->setRiskyAllowed(true);
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 4.6.1
- Update php-cs-fixer to V3

## 4.6.0
- Drop PHP 7.2 and add PHP 8.0 support.
- Upgrade all Laravel packages to ^8.x from ^5.8.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"twig/twig": "^2.11"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.13",
"friendsofphp/php-cs-fixer": "^3.0",
"phpunit/phpunit": "^9.5",
"slim/slim": "^3",
"mockery/mockery": "^1.2",
Expand Down

0 comments on commit a0522c6

Please sign in to comment.