From e92266ee8fbebc9283c8dbc5f78bc21f004d9ad3 Mon Sep 17 00:00:00 2001 From: Benoit Viguier Date: Thu, 24 Jan 2019 13:21:48 +0100 Subject: [PATCH] Support for php 7.2/7.3 --- README.md | 2 +- composer.json | 2 +- src/Php72.php | 36 ++++++++++++++++++++++++++++++++++++ src/Php73.php | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 src/Php72.php create mode 100644 src/Php73.php diff --git a/README.md b/README.md index 7ad15ea..80ef1e6 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Create a configuration file `.php_cs` in the root of your project: ```php getFinder() ->in([ diff --git a/composer.json b/composer.json index a904a9e..26c7051 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "friendsofphp/php-cs-fixer": "~2.13.0" + "friendsofphp/php-cs-fixer": "^2.14" }, "autoload": { "psr-4": { diff --git a/src/Php72.php b/src/Php72.php new file mode 100644 index 0000000..b760be5 --- /dev/null +++ b/src/Php72.php @@ -0,0 +1,36 @@ +setRiskyAllowed(true); + } + + public function getRules() + { + $rules = [ + '@Symfony' => true, + 'array_syntax' => [ + 'syntax' => 'short', + ], + 'no_unreachable_default_argument_value' => false, + 'braces' => [ + 'allow_single_line_closure' => true, + ], + 'heredoc_to_nowdoc' => false, + 'phpdoc_summary' => false, + 'increment_style' => ['style' => 'post'], + 'yoda_style' => false, + 'ordered_imports' => ['sort_algorithm' => 'alpha'], + ]; + + return $rules; + } +} diff --git a/src/Php73.php b/src/Php73.php new file mode 100644 index 0000000..70f110a --- /dev/null +++ b/src/Php73.php @@ -0,0 +1,36 @@ +setRiskyAllowed(true); + } + + public function getRules() + { + $rules = [ + '@Symfony' => true, + 'array_syntax' => [ + 'syntax' => 'short', + ], + 'no_unreachable_default_argument_value' => false, + 'braces' => [ + 'allow_single_line_closure' => true, + ], + 'heredoc_to_nowdoc' => false, + 'phpdoc_summary' => false, + 'increment_style' => ['style' => 'post'], + 'yoda_style' => false, + 'ordered_imports' => ['sort_algorithm' => 'alpha'], + ]; + + return $rules; + } +}