From 71a58db6899e6557aeab26914a0bca02d6b3b456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Guzm=C3=A1n=20Maeso?= Date: Tue, 12 Sep 2017 23:02:17 +0200 Subject: [PATCH 1/7] Add .php_cs fixer using 2.0 syntax --- .php_cs | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .php_cs diff --git a/.php_cs b/.php_cs new file mode 100644 index 000000000..3a6026569 --- /dev/null +++ b/.php_cs @@ -0,0 +1,59 @@ +setRiskyAllowed(true) + ->setRules([ + //'@PHP56Migration' => true, + '@Symfony' => true, + //'@Symfony:risky' => true, + //'align_multiline_comment' => true, + 'array_syntax' => ['syntax' => 'long'], + //'blank_line_before_statement' => true, + 'combine_consecutive_unsets' => true, + 'linebreak_after_opening_tag' => true, + // one should use PHPUnit methods to set up expected exception instead of annotations + //'general_phpdoc_annotation_remove' => ['annotations' => ['expectedException', 'expectedExceptionMessage', 'expectedExceptionMessageRegExp']], + 'header_comment' => ['header' => $header], + //'heredoc_to_nowdoc' => true, + 'list_syntax' => ['syntax' => 'long'], + //'method_argument_space' => ['ensure_fully_multiline' => true], + //'no_extra_consecutive_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']], + //'no_null_property_initialization' => true, + 'no_short_echo_tag' => true, + //'no_superfluous_elseif' => true, + //'no_unneeded_curly_braces' => true, + //'no_unneeded_final_method' => true, + //'no_unreachable_default_argument_value' => true, + //'no_useless_else' => true, + //'no_useless_return' => true, + //'ordered_class_elements' => true, + 'ordered_imports' => true, + 'php_unit_construct' => true, + 'php_unit_dedicate_assert' => true, + //'php_unit_strict' => true, + //'php_unit_test_class_requires_covers' => true, + //'phpdoc_add_missing_param_annotation' => true, + 'phpdoc_order' => true, + //'phpdoc_types_order' => true, + //'semicolon_after_instruction' => true, + //'single_line_comment_style' => true, + //'strict_comparison' => true, + //'strict_param' => true, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->name("*.php") + ->name("*.twig") + ->exclude('vendor/var') + ->in(__DIR__) + ) +; From 1834377181fa41e5b79b8af9f56c5c846ef10574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Guzm=C3=A1n=20Maeso?= Date: Tue, 12 Sep 2017 23:02:50 +0200 Subject: [PATCH 2/7] Remove .php_cs.dist used by StyleCI --- .php_cs.dist | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 .php_cs.dist diff --git a/.php_cs.dist b/.php_cs.dist deleted file mode 100644 index b2551b4d9..000000000 --- a/.php_cs.dist +++ /dev/null @@ -1,32 +0,0 @@ -setRules(array_merge($config->getRules(), array( - 'header_comment' => array('header' => $header) - ))) - ->setUsingCache(false); - -return $config; From a71818e9e84d5ae74b8fd752b3b088a026fbcaa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Guzm=C3=A1n=20Maeso?= Date: Tue, 12 Sep 2017 23:03:07 +0200 Subject: [PATCH 3/7] Remove .styleci.yml config file --- .styleci.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 .styleci.yml diff --git a/.styleci.yml b/.styleci.yml deleted file mode 100644 index b88748db9..000000000 --- a/.styleci.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- - -preset: symfony - -enabled: - - combine_consecutive_unsets - - linebreak_after_opening_tag - - no_short_echo_tag - - ordered_imports - - phpdoc_order - - php_unit_construct - - php_unit_dedicate_assert - - long_array_syntax - -finder : - name : [ "*.php", "*.twig" ] - exclude : [ "vendor", "var" ] - path : [ "./" ] - -... From 7f919e9d9cd5506934652461e46f1a8218a90b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Guzm=C3=A1n=20Maeso?= Date: Tue, 12 Sep 2017 23:04:30 +0200 Subject: [PATCH 4/7] Remove the bagde unused in Readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a0c185b22..26c4b298d 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # LiipImagineBundle -| Travis-CI | Style-CI | Coverage | Downloads | Release | -|:----------------------:|:-----------------------:|:-----------------------:|:-----------------------:|:-----------------------:| -| [![Travis](https://src.run/shield/liip/LiipImagineBundle/1.0/travis.svg)](https://src.run/service/liip/LiipImagineBundle/1.0/travis) | [![Style CI](https://src.run/shield/liip/LiipImagineBundle/1.0/styleci.svg)](https://src.run/service/liip/LiipImagineBundle/1.0/styleci) | [![Coverage](https://src.run/shield/liip/LiipImagineBundle/1.0/coveralls.svg)](https://src.run/service/liip/LiipImagineBundle/1.0/coveralls) | [![Downloads](https://src.run/shield/liip/LiipImagineBundle/packagist_dt.svg)](https://src.run/service/liip/LiipImagineBundle/packagist) | [![Latest Stable Version](https://src.run/shield/liip/LiipImagineBundle/packagist_v.svg)](https://src.run/service/liip/LiipImagineBundle/packagist) | +| Travis-CI | Coverage | Downloads | Release | +|:----------------------:|:-----------------------:|:-----------------------:|:-----------------------:| +| [![Travis](https://src.run/shield/liip/LiipImagineBundle/1.0/travis.svg)](https://src.run/service/liip/LiipImagineBundle/1.0/travis) | [![Coverage](https://src.run/shield/liip/LiipImagineBundle/1.0/coveralls.svg)](https://src.run/service/liip/LiipImagineBundle/1.0/coveralls) | [![Downloads](https://src.run/shield/liip/LiipImagineBundle/packagist_dt.svg)](https://src.run/service/liip/LiipImagineBundle/packagist) | [![Latest Stable Version](https://src.run/shield/liip/LiipImagineBundle/packagist_v.svg)](https://src.run/service/liip/LiipImagineBundle/packagist) | *This bundle provides an image manipulation abstraction toolkit for [Symfony](http://symfony.com/)-based projects.* From d922d9468723dc2ef5d1bf7c8223282ba8fd522c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Guzm=C3=A1n=20Maeso?= Date: Wed, 13 Sep 2017 01:13:44 +0200 Subject: [PATCH 5/7] Remove rule comments and identation errors --- .php_cs | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/.php_cs b/.php_cs index 3a6026569..71d4b016d 100644 --- a/.php_cs +++ b/.php_cs @@ -12,42 +12,17 @@ EOF; $config = PhpCsFixer\Config::create() ->setRiskyAllowed(true) ->setRules([ - //'@PHP56Migration' => true, '@Symfony' => true, - //'@Symfony:risky' => true, - //'align_multiline_comment' => true, 'array_syntax' => ['syntax' => 'long'], - //'blank_line_before_statement' => true, 'combine_consecutive_unsets' => true, 'linebreak_after_opening_tag' => true, - // one should use PHPUnit methods to set up expected exception instead of annotations - //'general_phpdoc_annotation_remove' => ['annotations' => ['expectedException', 'expectedExceptionMessage', 'expectedExceptionMessageRegExp']], 'header_comment' => ['header' => $header], - //'heredoc_to_nowdoc' => true, 'list_syntax' => ['syntax' => 'long'], - //'method_argument_space' => ['ensure_fully_multiline' => true], - //'no_extra_consecutive_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']], - //'no_null_property_initialization' => true, 'no_short_echo_tag' => true, - //'no_superfluous_elseif' => true, - //'no_unneeded_curly_braces' => true, - //'no_unneeded_final_method' => true, - //'no_unreachable_default_argument_value' => true, - //'no_useless_else' => true, - //'no_useless_return' => true, - //'ordered_class_elements' => true, - 'ordered_imports' => true, - 'php_unit_construct' => true, + 'ordered_imports' => true, + 'php_unit_construct' => true, 'php_unit_dedicate_assert' => true, - //'php_unit_strict' => true, - //'php_unit_test_class_requires_covers' => true, - //'phpdoc_add_missing_param_annotation' => true, 'phpdoc_order' => true, - //'phpdoc_types_order' => true, - //'semicolon_after_instruction' => true, - //'single_line_comment_style' => true, - //'strict_comparison' => true, - //'strict_param' => true, ]) ->setFinder( PhpCsFixer\Finder::create() From eccadb87cb722b58f2c0f6b3e206368a88ee9dfe Mon Sep 17 00:00:00 2001 From: Cedric Ziel Date: Wed, 13 Sep 2017 10:50:02 +0200 Subject: [PATCH 6/7] Fix separators from tabs to spaces --- .php_cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.php_cs b/.php_cs index 71d4b016d..3168fc017 100644 --- a/.php_cs +++ b/.php_cs @@ -15,13 +15,13 @@ $config = PhpCsFixer\Config::create() '@Symfony' => true, 'array_syntax' => ['syntax' => 'long'], 'combine_consecutive_unsets' => true, - 'linebreak_after_opening_tag' => true, + 'linebreak_after_opening_tag' => true, 'header_comment' => ['header' => $header], 'list_syntax' => ['syntax' => 'long'], 'no_short_echo_tag' => true, - 'ordered_imports' => true, - 'php_unit_construct' => true, - 'php_unit_dedicate_assert' => true, + 'ordered_imports' => true, + 'php_unit_construct' => true, + 'php_unit_dedicate_assert' => true, 'phpdoc_order' => true, ]) ->setFinder( From 2d64fb430f511a0547cf20e73fb44a88e8be1886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Guzm=C3=A1n=20Maeso?= Date: Wed, 20 Sep 2017 19:12:02 +0200 Subject: [PATCH 7/7] Update header and rules according to review --- .php_cs | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/.php_cs b/.php_cs index 3168fc017..a3771d9c4 100644 --- a/.php_cs +++ b/.php_cs @@ -1,28 +1,38 @@ setRiskyAllowed(true) ->setRules([ - '@Symfony' => true, - 'array_syntax' => ['syntax' => 'long'], - 'combine_consecutive_unsets' => true, - 'linebreak_after_opening_tag' => true, - 'header_comment' => ['header' => $header], - 'list_syntax' => ['syntax' => 'long'], - 'no_short_echo_tag' => true, - 'ordered_imports' => true, - 'php_unit_construct' => true, - 'php_unit_dedicate_assert' => true, - 'phpdoc_order' => true, + '@Symfony' => true, + '@Symfony:risky' => true, + 'array_syntax' => array('syntax' => 'long'), + 'combine_consecutive_unsets' => true, + 'header_comment' => array('header' => $header), + 'heredoc_to_nowdoc' => true, + 'linebreak_after_opening_tag' => true, + 'list_syntax' => array('syntax' => 'long'), + 'no_short_echo_tag' => true, + 'no_unreachable_default_argument_value' => true, + 'no_useless_else' => true, + 'no_useless_return' => true, + 'ordered_class_elements' => true, + 'ordered_imports' => true, + 'php_unit_construct' => true, + 'php_unit_dedicate_assert' => true, + 'phpdoc_add_missing_param_annotation' => true, + 'phpdoc_order' => true, + 'psr4' => true, + 'strict_comparison' => true, + 'strict_param' => true, ]) ->setFinder( PhpCsFixer\Finder::create()