Browse Source

clean ups

SpacePossum 4 years ago
parent
commit
6db872358e

+ 94 - 23
UPGRADE-v3.md

@@ -6,13 +6,14 @@ This is guide for upgrade from version 2.x to 3.0 for using the CLI tool.
 CLI options
 CLI options
 -----------
 -----------
 
 
-| 2.x             | 3.0             | Description                                     | Note                                   |
+| 2.x              | 3.0             | Description                                     | Note                                   |
-| --------------- | --------------- | ----------------------------------------------- | -------------------------------------- |
+| ---------------- | --------------- | ----------------------------------------------- | -------------------------------------- |
-| --diff-format   | --diff-format   | Type of differ                                  | Allowed value `sbd` was removed,       |
+| --diff-format    | --diff-format   | Type of differ                                  | Allowed value `sbd` was removed,       |
-|                 |                 |                                                 | new default is `udiff`                 |
+|                  |                 |                                                 | new default is `udiff`                 |
-| --show-progress | --show-progress | Type of progress indicator                      | Allowed values were modified:          |
+| --show-progress  | --show-progress | Type of progress indicator                      | Allowed values were modified:          |
-|                 |                 |                                                 | `run-in` and `estimating` was removed, |
+|                  |                 |                                                 | `run-in` and `estimating` was removed, |
-|                 |                 |                                                 | `estimating-max` was removed to `dots` |
+|                  |                 |                                                 | `estimating-max` was removed to `dots` |
+| --config --rules |                 |                                                 | No longer allowed to pass both         |
 
 
 Changes to rules
 Changes to rules
 ----------------
 ----------------
@@ -21,15 +22,20 @@ Changes to rules
 
 
 Old name | New name | Note
 Old name | New name | Note
 -------- | -------- | ----
 -------- | -------- | ----
-`blank_line_before_return`                      | `blank_line_before_statement`                 | use configuration `['statements' => ['return']]`
+`blank_line_before_return`                      | `blank_line_before_statement`                                                     | use configuration `['statements' => ['return']]`
-`hash_to_slash_comment`                         | `single_line_comment_style`                   | use configuration `['comment_types' => ['hash']]`
+`hash_to_slash_comment`                         | `single_line_comment_style`                                                       | use configuration `['comment_types' => ['hash']]`
-`lowercase_constants`                           | `constant_case`                               | use configuration `['case' => 'lower']`
+`lowercase_constants`                           | `constant_case`                                                                   | use configuration `['case' => 'lower']`
-`method_separation`                             | `class_attributes_separation`                 | use configuration `['elements' => ['method']]`
+`method_separation`                             | `class_attributes_separation`                                                     | use configuration `['elements' => ['method']]`
-`no_extra_consecutive_blank_lines`              | `no_extra_blank_lines`                        |
+`no_extra_consecutive_blank_lines`              | `no_extra_blank_lines`                                                            |
-`no_short_echo_tag`                             | `echo_tag_syntax`                             | use configuration `['format' => 'long']`
+`no_multiline_whitespace_before_semicolons`     | `multiline_whitespace_before_semicolons`                                          |
-`php_unit_ordered_covers`                       | `phpdoc_order_by_value`                       | use configuration `['annotations' => [ 'covers' ]]`
+`no_short_echo_tag`                             | `echo_tag_syntax`                                                                 | use configuration `['format' => 'long']`
-`pre_increment`                                 | `increment_style`                             | use configuration `['style' => 'pre']`
+`php_unit_ordered_covers`                       | `phpdoc_order_by_value`                                                           | use configuration `['annotations' => [ 'covers' ]]`
-`silenced_deprecation_error`                    | `error_suppression`                           |
+`pre_increment`                                 | `increment_style`                                                                 | use configuration `['style' => 'pre']`
+`psr0`                                          | `psr_autoloading`                                                                 | use configuration `['dir' => x ]`
+`psr4`                                          | `psr_autoloading`                                                                 |
+`silenced_deprecation_error`                    | `error_suppression`                                                               |
+`final_static_access`                           | `self_static_accessor`                                                            |
+`phpdoc_inline_tag`                             | `general_phpdoc_tag_rename`, `phpdoc_inline_tag_normalizer` and `phpdoc_tag_type` |
 
 
 ### Removed rootless configuration
 ### Removed rootless configuration
 
 
@@ -53,13 +59,25 @@ Rule                                 | Root option    | Note
 
 
 Rule | Option | Change
 Rule | Option | Change
 ---- | ------ | ------
 ---- | ------ | ------
-`binary_operator_spaces`           | `align_double_arrow` | option was removed, use `operators` instead
+`binary_operator_spaces`                 | `align_double_arrow`                         | option was removed, use `operators` instead
-`binary_operator_spaces`           | `align_equals`       | option was removed use `operators` instead
+`binary_operator_spaces`                 | `align_equals`                               | option was removed use `operators` instead
-`doctrine_annotation_spaces`       | `around_argument_assignments` | option was removed, use `before_argument_assignments` and `after_argument_assignments` instead
+`blank_line_before_statement`            | `statements: die`                            | option `die` was removed from `statements`, use `exit` instead
-`doctrine_annotation_spaces`       | `around_array_assignments`    | option was removed, use `after_array_assignments_colon`, `after_array_assignments_equals`, `before_array_assignments_colon` and `before_array_assignments_equals` instead
+`class_definition`                       | `multiLineExtendsEachSingleLine`             | option was renamed to  `multi_line_extends_each_single_line`
-`is_null`                          | `use_yoda_style` | option was removed, use `yoda_style` rule instead
+`class_definition`                       | `singleItemSingleLine`                       | option was renamed to  `single_item_single_line`
-`no_extra_consecutive_blank_lines` | `tokens`    | one of possible values, `useTrait`, was renamed to `use_trait`
+`class_definition`                       | `singleLine`                                 | option was renamed to  `single_line`
-`php_unit_dedicate_assert`         | `functions` | option was removed, use `target` instead
+`doctrine_annotation_spaces`             | `around_argument_assignments`                | option was removed, use `before_argument_assignments` and `after_argument_assignments` instead
+`doctrine_annotation_spaces`             | `around_array_assignments`                   | option was removed, use `after_array_assignments_colon`, `after_array_assignments_equals`, `before_array_assignments_colon` and `before_array_assignments_equals` instead
+`final_internal_class`                   | `annotation-black-list`                      | option was renamed, use `annotation_exclude`
+`final_internal_class`                   | `annotation-white-list`                      | option was renamed, use `annotation_include`
+`final_internal_class`                   | `consider-absent-docblock-as-internal-class` | option was renamed, use `consider_absent_docblock_as_internal_class`
+`header_comment`                         | `commentType`                                | option was renamed to `comment_type`
+`is_null`                                | `use_yoda_style`                             | option was removed, use `yoda_style` rule instead
+`no_extra_consecutive_blank_lines`       | `tokens`                                     | one of possible values, `useTrait`, was renamed to `use_trait`
+`ordered_class_elements`                 | `sortAlgorithm`                              | option was renamed, use `sort_algorithm` instead
+`ordered_imports`                        | `importsOrder`                               | option was renamed, use `imports_order`
+`ordered_imports`                        | `sortAlgorithm`                              | option was renamed, use `sort_algorithm`
+`php_unit_dedicate_assert_internal_type` | `target`                                     | option was removed, it was not used
+`php_unit_dedicate_assert`               | `functions`                                  | option was removed, use `target` instead
 
 
 ### Changed default values of options
 ### Changed default values of options
 
 
@@ -67,12 +85,65 @@ Rule | Option | Old value | New value
 ---- | ---- | ---- | ----
 ---- | ---- | ---- | ----
 `function_to_constant` | `functions` | `['get_class', 'php_sapi_name', 'phpversion', 'pi']` | `['get_called_class', 'get_class', 'php_sapi_name', 'phpversion', 'pi']`
 `function_to_constant` | `functions` | `['get_class', 'php_sapi_name', 'phpversion', 'pi']` | `['get_called_class', 'get_class', 'php_sapi_name', 'phpversion', 'pi']`
 `method_argument_space` | `on_multiline` | `'ignore'` | `'ensure_fully_multiline'`
 `method_argument_space` | `on_multiline` | `'ignore'` | `'ensure_fully_multiline'`
+`native_function_casing` | `include` | `@internal` | `@compiler_optimized`
 `native_function_invocation` | `include` | `@internal` | `@compiler_optimized`
 `native_function_invocation` | `include` | `@internal` | `@compiler_optimized`
 `php_unit_dedicate_assert` | `target` | `5.0` | `newest`
 `php_unit_dedicate_assert` | `target` | `5.0` | `newest`
 `phpdoc_align` | `tags` | `['param', 'return', 'throws', 'type', 'var']` | `['method', 'param', 'property', 'return', 'throws', 'type', 'var']`
 `phpdoc_align` | `tags` | `['param', 'return', 'throws', 'type', 'var']` | `['method', 'param', 'property', 'return', 'throws', 'type', 'var']`
+`phpdoc_scalar` | `types` | `['boolean', 'double', 'integer', 'real', 'str']` | `['boolean', 'callback', 'double', 'integer', 'real', 'str']`
+
+### Updated rule sets
+
+- `@PHPUnit50MigrationRiskySet`
+- `@SymfonyRiskySet`
+- `@SymfonySet`
 
 
 ### Removed rule sets
 ### Removed rule sets
 
 
 Rule set | Note
 Rule set | Note
 -------- | ----
 -------- | ----
 `@PHP56Migration` | was empty
 `@PHP56Migration` | was empty
+
+### Rule behavior changes
+
+- `no_unused_imports` now runs all files defined in the configuration (used to exclude some hardcoded directories)
+
+### Various
+
+- `udiff` output now includes the file name in the output (if applicable)
+
+Code BC changes
+===============
+
+### Removed; various
+
+- class `AbstractAlignFixerHelper` has been removed
+- class `AccessibleObject` has been removed
+- class `AlignDoubleArrowFixerHelper` has been removed
+- class `AlignEqualsFixerHelper` has been removed
+- class `FixerConfigurationResolverRootless` has been removed
+- `HeaderCommentFixer` deprecated properties have been removed
+- `MethodArgumentSpaceFixer` deprecated methods have been removed
+- `NoMixedEchoPrintFixer` the property `$defaultConfig` has been removed
+- class `Tokens`, the following methods has been removed:
+    - `current()`
+    - `key()`
+    - `next()`
+    - `rewind()`
+    - `valid()`
+
+### Interface changes
+
+- `ConfigurableFixerInterface` has been updated
+- `ConfigurationDefinitionFixerInterface` has been removed in favor of the updated `ConfigurableFixerInterface`
+- `DefinedFixerInterface` has been removed, related methods are now part of the updated `FixerInterface` interface
+- `DifferInterface` has been updated
+- `FixerInterface` interface has been updated
+- `PhpCsFixer\RuleSetInterface` has been removed in favor of `\PhpCsFixer\RuleSet\RuleSetInterface`
+
+### BC breaks; various
+
+- class `Token` is now `final`
+- class `Tokens` is now `final`
+- method `create` of class `Config` has been removed, use the constructor
+- method `create` of class `RuleSet` has been removed, use the constructor
+- method `getSetDefinitionNames` of class `RuleSet` has been removed, use `RuleSets::getSetDefinitionNames()`

+ 0 - 61
doc/rules/basic/psr0.rst

@@ -1,61 +0,0 @@
-=============
-Rule ``psr0``
-=============
-
-.. warning:: This rule is deprecated and will be removed on next major version.
-
-   You should use ``psr_autoloading`` instead.
-
-Classes must be in a path that matches their namespace, be at least one
-namespace deep and the class name should match the file name.
-
-.. warning:: Using this rule is risky.
-
-   This fixer may change your class name, which will break the code that depends
-   on the old name.
-
-Configuration
--------------
-
-``dir``
-~~~~~~~
-
-The directory where the project code is placed.
-
-Allowed types: ``string``
-
-Default value: ``''``
-
-Examples
---------
-
-Example #1
-~~~~~~~~~~
-
-*Default* configuration.
-
-.. code-block:: diff
-
-   --- Original
-   +++ New
-   @@ -1,3 +1,3 @@
-    <?php
-    namespace PhpCsFixer\FIXER\Basic;
-   -class InvalidName {}
-   +class PsrAutoloadingFixer {}
-
-Example #2
-~~~~~~~~~~
-
-With configuration: ``['dir' => './src']``.
-
-.. code-block:: diff
-
-   --- Original
-   +++ New
-   @@ -1,3 +1,3 @@
-    <?php
-   -namespace PhpCsFixer\FIXER\Basic;
-   -class InvalidName {}
-   +namespace PhpCsFixer\Fixer\Basic;
-   +class PsrAutoloadingFixer {}

+ 0 - 30
doc/rules/basic/psr4.rst

@@ -1,30 +0,0 @@
-=============
-Rule ``psr4``
-=============
-
-.. warning:: This rule is deprecated and will be removed on next major version.
-
-   You should use ``psr_autoloading`` instead.
-
-Class names should match the file name.
-
-.. warning:: Using this rule is risky.
-
-   This fixer may change your class name, which will break the code that depends
-   on the old name.
-
-Examples
---------
-
-Example #1
-~~~~~~~~~~
-
-.. code-block:: diff
-
-   --- Original
-   +++ New
-   @@ -1,3 +1,3 @@
-    <?php
-    namespace PhpCsFixer\FIXER\Basic;
-   -class InvalidName {}
-   +class PsrAutoloadingFixer {}

+ 0 - 6
doc/rules/class_notation/class_definition.rst

@@ -13,8 +13,6 @@ Configuration
 
 
 Whether definitions should be multiline.
 Whether definitions should be multiline.
 
 
-.. note:: The previous name of this option was ``multiLineExtendsEachSingleLine`` but it is now deprecated and will be removed on next major version.
-
 Allowed types: ``bool``
 Allowed types: ``bool``
 
 
 Default value: ``false``
 Default value: ``false``
@@ -24,8 +22,6 @@ Default value: ``false``
 
 
 Whether definitions should be single line when including a single item.
 Whether definitions should be single line when including a single item.
 
 
-.. note:: The previous name of this option was ``singleItemSingleLine`` but it is now deprecated and will be removed on next major version.
-
 Allowed types: ``bool``
 Allowed types: ``bool``
 
 
 Default value: ``false``
 Default value: ``false``
@@ -35,8 +31,6 @@ Default value: ``false``
 
 
 Whether definitions should be single line.
 Whether definitions should be single line.
 
 
-.. note:: The previous name of this option was ``singleLine`` but it is now deprecated and will be removed on next major version.
-
 Allowed types: ``bool``
 Allowed types: ``bool``
 
 
 Default value: ``false``
 Default value: ``false``

+ 0 - 6
doc/rules/class_notation/final_internal_class.rst

@@ -17,8 +17,6 @@ Configuration
 Class level annotations tags that must be set in order to fix the class. (case
 Class level annotations tags that must be set in order to fix the class. (case
 insensitive)
 insensitive)
 
 
-.. note:: The previous name of this option was ``annotation-white-list`` but it is now deprecated and will be removed on next major version.
-
 Allowed types: ``array``
 Allowed types: ``array``
 
 
 Default value: ``['@internal']``
 Default value: ``['@internal']``
@@ -29,8 +27,6 @@ Default value: ``['@internal']``
 Class level annotations tags that must be omitted to fix the class, even if all
 Class level annotations tags that must be omitted to fix the class, even if all
 of the white list ones are used as well. (case insensitive)
 of the white list ones are used as well. (case insensitive)
 
 
-.. note:: The previous name of this option was ``annotation-black-list`` but it is now deprecated and will be removed on next major version.
-
 Allowed types: ``array``
 Allowed types: ``array``
 
 
 Default value: ``['@final', '@Entity', '@ORM\\Entity', '@ORM\\Mapping\\Entity', '@Mapping\\Entity']``
 Default value: ``['@final', '@Entity', '@ORM\\Entity', '@ORM\\Mapping\\Entity', '@Mapping\\Entity']``
@@ -40,8 +36,6 @@ Default value: ``['@final', '@Entity', '@ORM\\Entity', '@ORM\\Mapping\\Entity',
 
 
 Should classes without any DocBlock be fixed to final?
 Should classes without any DocBlock be fixed to final?
 
 
-.. note:: The previous name of this option was ``consider-absent-docblock-as-internal-class`` but it is now deprecated and will be removed on next major version.
-
 Allowed types: ``bool``
 Allowed types: ``bool``
 
 
 Default value: ``false``
 Default value: ``false``

+ 0 - 28
doc/rules/class_notation/final_static_access.rst

@@ -1,28 +0,0 @@
-============================
-Rule ``final_static_access``
-============================
-
-.. warning:: This rule is deprecated and will be removed on next major version.
-
-   You should use ``self_static_accessor`` instead.
-
-Converts ``static`` access to ``self`` access in ``final`` classes.
-
-Examples
---------
-
-Example #1
-~~~~~~~~~~
-
-.. code-block:: diff
-
-   --- Original
-   +++ New
-   @@ -3,6 +3,6 @@
-    {
-        public function getFoo()
-        {
-   -        return static::class;
-   +        return self::class;
-        }
-    }

+ 0 - 2
doc/rules/class_notation/ordered_class_elements.rst

@@ -21,8 +21,6 @@ Default value: ``['use_trait', 'constant_public', 'constant_protected', 'constan
 
 
 How multiple occurrences of same type statements should be sorted
 How multiple occurrences of same type statements should be sorted
 
 
-.. note:: The previous name of this option was ``sortAlgorithm`` but it is now deprecated and will be removed on next major version.
-
 Allowed values: ``'alpha'``, ``'none'``
 Allowed values: ``'alpha'``, ``'none'``
 
 
 Default value: ``'none'``
 Default value: ``'none'``

+ 0 - 2
doc/rules/comment/header_comment.rst

@@ -21,8 +21,6 @@ This option is required.
 
 
 Comment syntax type.
 Comment syntax type.
 
 
-.. note:: The previous name of this option was ``commentType`` but it is now deprecated and will be removed on next major version.
-
 Allowed values: ``'comment'``, ``'PHPDoc'``
 Allowed values: ``'comment'``, ``'PHPDoc'``
 
 
 Default value: ``'comment'``
 Default value: ``'comment'``

+ 0 - 11
doc/rules/function_notation/method_argument_space.rst

@@ -20,17 +20,6 @@ Allowed types: ``bool``
 
 
 Default value: ``false``
 Default value: ``false``
 
 
-``ensure_fully_multiline``
-~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-.. warning:: This option is deprecated and will be removed on next major version. Use option ``on_multiline`` instead.
-
-ensure every argument of a multiline argument list is on its own line
-
-Allowed types: ``bool``
-
-Default value: ``false``
-
 ``on_multiline``
 ``on_multiline``
 ~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~
 
 

+ 0 - 4
doc/rules/import/ordered_imports.rst

@@ -13,8 +13,6 @@ Configuration
 whether the statements should be sorted alphabetically or by length, or not
 whether the statements should be sorted alphabetically or by length, or not
 sorted
 sorted
 
 
-.. note:: The previous name of this option was ``sortAlgorithm`` but it is now deprecated and will be removed on next major version.
-
 Allowed values: ``'alpha'``, ``'length'``, ``'none'``
 Allowed values: ``'alpha'``, ``'length'``, ``'none'``
 
 
 Default value: ``'alpha'``
 Default value: ``'alpha'``
@@ -24,8 +22,6 @@ Default value: ``'alpha'``
 
 
 Defines the order of import types.
 Defines the order of import types.
 
 
-.. note:: The previous name of this option was ``importsOrder`` but it is now deprecated and will be removed on next major version.
-
 Allowed types: ``array``, ``null``
 Allowed types: ``array``, ``null``
 
 
 Default value: ``null``
 Default value: ``null``

Some files were not shown because too many files changed in this diff