Browse Source

minor #5656 DX: mark some constants as internal or private (keradus)

This PR was squashed before being merged into the 3.0 branch.

Discussion
----------

DX: mark some constants as internal or private

Commits
-------

e3637e249 DX: mark some constants as internal or private
Dariusz Ruminski 3 years ago
parent
commit
e0c63e4514

+ 1 - 3
src/DocBlock/Annotation.php

@@ -28,10 +28,8 @@ final class Annotation
 {
 {
     /**
     /**
      * Regex to match any types, shall be used with `x` modifier.
      * Regex to match any types, shall be used with `x` modifier.
-     *
-     * @internal
      */
      */
-    public const REGEX_TYPES = '
+    private const REGEX_TYPES = '
     # <simple> is any non-array, non-generic, non-alternated type, eg `int` or `\Foo`
     # <simple> is any non-array, non-generic, non-alternated type, eg `int` or `\Foo`
     # <array> is array of <simple>, eg `int[]` or `\Foo[]`
     # <array> is array of <simple>, eg `int[]` or `\Foo[]`
     # <generic> is generic collection type, like `array<string, int>`, `Collection<Item>` and more complex like `Collection<int, \null|SubCollection<string>>`
     # <generic> is generic collection type, like `array<string, int>`, `Collection<Item>` and more complex like `Collection<int, \null|SubCollection<string>>`

+ 1 - 4
src/Fixer/CastNotation/CastSpacesFixer.php

@@ -30,10 +30,7 @@ use PhpCsFixer\Tokenizer\Tokens;
  */
  */
 final class CastSpacesFixer extends AbstractFixer implements ConfigurableFixerInterface
 final class CastSpacesFixer extends AbstractFixer implements ConfigurableFixerInterface
 {
 {
-    /**
-     * @internal
-     */
-    public const INSIDE_CAST_SPACE_REPLACE_MAP = [
+    private const INSIDE_CAST_SPACE_REPLACE_MAP = [
         ' ' => '',
         ' ' => '',
         "\t" => '',
         "\t" => '',
         "\n" => '',
         "\n" => '',

+ 2 - 9
src/Fixer/ClassNotation/ClassAttributesSeparationFixer.php

@@ -49,15 +49,8 @@ final class ClassAttributesSeparationFixer extends AbstractFixer implements Conf
      */
      */
     public const SPACING_ONE = 'one';
     public const SPACING_ONE = 'one';
 
 
-    /**
-     * @internal
-     */
-    public const SUPPORTED_SPACINGS = [self::SPACING_NONE, self::SPACING_ONE];
-
-    /**
-     * @internal
-     */
-    public const SUPPORTED_TYPES = ['const', 'method', 'property'];
+    private const SUPPORTED_SPACINGS = [self::SPACING_NONE, self::SPACING_ONE];
+    private const SUPPORTED_TYPES = ['const', 'method', 'property'];
 
 
     /**
     /**
      * @var array<string, string>
      * @var array<string, string>

+ 3 - 12
src/Fixer/Comment/NoEmptyCommentFixer.php

@@ -26,20 +26,11 @@ use PhpCsFixer\Tokenizer\Tokens;
  */
  */
 final class NoEmptyCommentFixer extends AbstractFixer
 final class NoEmptyCommentFixer extends AbstractFixer
 {
 {
-    /**
-     * @internal
-     */
-    public const TYPE_HASH = 1;
+    private const TYPE_HASH = 1;
 
 
-    /**
-     * @internal
-     */
-    public const TYPE_DOUBLE_SLASH = 2;
+    private const TYPE_DOUBLE_SLASH = 2;
 
 
-    /**
-     * @internal
-     */
-    public const TYPE_SLASH_ASTERISK = 3;
+    private const TYPE_SLASH_ASTERISK = 3;
 
 
     /**
     /**
      * {@inheritdoc}
      * {@inheritdoc}

+ 2 - 4
src/Fixer/FunctionNotation/PhpdocToParamTypeFixer.php

@@ -31,11 +31,9 @@ use PhpCsFixer\Tokenizer\Tokens;
  */
  */
 final class PhpdocToParamTypeFixer extends AbstractPhpdocToTypeDeclarationFixer
 final class PhpdocToParamTypeFixer extends AbstractPhpdocToTypeDeclarationFixer
 {
 {
-    /** @internal */
-    public const CLASS_REGEX = '/^\\\\?[a-zA-Z_\\x7f-\\xff](?:\\\\?[a-zA-Z0-9_\\x7f-\\xff]+)*(?<array>\[\])*$/';
+    private const CLASS_REGEX = '/^\\\\?[a-zA-Z_\\x7f-\\xff](?:\\\\?[a-zA-Z0-9_\\x7f-\\xff]+)*(?<array>\[\])*$/';
 
 
-    /** @internal */
-    public const MINIMUM_PHP_VERSION = 70000;
+    private const MINIMUM_PHP_VERSION = 70000;
 
 
     /**
     /**
      * @var array{int, string}[]
      * @var array{int, string}[]

+ 4 - 19
src/Fixer/FunctionNotation/SingleLineThrowFixer.php

@@ -27,25 +27,10 @@ use PhpCsFixer\Tokenizer\Tokens;
  */
  */
 final class SingleLineThrowFixer extends AbstractFixer
 final class SingleLineThrowFixer extends AbstractFixer
 {
 {
-    /**
-     * @internal
-     */
-    public const REMOVE_WHITESPACE_AFTER_TOKENS = ['['];
-
-    /**
-     * @internal
-     */
-    public const REMOVE_WHITESPACE_AROUND_TOKENS = ['(', [T_DOUBLE_COLON]];
-
-    /**
-     * @internal
-     */
-    public const REMOVE_WHITESPACE_BEFORE_TOKENS = [')',  ']', ',', ';'];
-
-    /**
-     * @internal
-     */
-    public const THROW_END_TOKENS = [';', '(', '{', '}'];
+    private const REMOVE_WHITESPACE_AFTER_TOKENS = ['['];
+    private const REMOVE_WHITESPACE_AROUND_TOKENS = ['(', [T_DOUBLE_COLON]];
+    private const REMOVE_WHITESPACE_BEFORE_TOKENS = [')',  ']', ',', ';'];
+    private const THROW_END_TOKENS = [';', '(', '{', '}'];
 
 
     /**
     /**
      * {@inheritdoc}
      * {@inheritdoc}

+ 3 - 0
src/Fixer/Import/OrderedImportsFixer.php

@@ -66,6 +66,9 @@ final class OrderedImportsFixer extends AbstractFixer implements ConfigurableFix
      */
      */
     public const SORT_LENGTH = 'length';
     public const SORT_LENGTH = 'length';
 
 
+    /**
+     * @internal
+     */
     public const SORT_NONE = 'none';
     public const SORT_NONE = 'none';
 
 
     /**
     /**

+ 11 - 0
src/Fixer/LanguageConstruct/ErrorSuppressionFixer.php

@@ -32,8 +32,19 @@ use PhpCsFixer\Tokenizer\Tokens;
  */
  */
 final class ErrorSuppressionFixer extends AbstractFixer implements ConfigurableFixerInterface
 final class ErrorSuppressionFixer extends AbstractFixer implements ConfigurableFixerInterface
 {
 {
+    /**
+     * @internal
+     */
     public const OPTION_MUTE_DEPRECATION_ERROR = 'mute_deprecation_error';
     public const OPTION_MUTE_DEPRECATION_ERROR = 'mute_deprecation_error';
+
+    /**
+     * @internal
+     */
     public const OPTION_NOISE_REMAINING_USAGES = 'noise_remaining_usages';
     public const OPTION_NOISE_REMAINING_USAGES = 'noise_remaining_usages';
+
+    /**
+     * @internal
+     */
     public const OPTION_NOISE_REMAINING_USAGES_EXCLUDE = 'noise_remaining_usages_exclude';
     public const OPTION_NOISE_REMAINING_USAGES_EXCLUDE = 'noise_remaining_usages_exclude';
 
 
     /**
     /**

+ 1 - 4
src/Fixer/Operator/OperatorLinebreakFixer.php

@@ -35,10 +35,7 @@ use PhpCsFixer\Tokenizer\Tokens;
  */
  */
 final class OperatorLinebreakFixer extends AbstractFixer implements ConfigurableFixerInterface
 final class OperatorLinebreakFixer extends AbstractFixer implements ConfigurableFixerInterface
 {
 {
-    /**
-     * @internal
-     */
-    public const BOOLEAN_OPERATORS = [[T_BOOLEAN_AND], [T_BOOLEAN_OR], [T_LOGICAL_AND], [T_LOGICAL_OR], [T_LOGICAL_XOR]];
+    private const BOOLEAN_OPERATORS = [[T_BOOLEAN_AND], [T_BOOLEAN_OR], [T_LOGICAL_AND], [T_LOGICAL_OR], [T_LOGICAL_XOR]];
 
 
     /**
     /**
      * @var string
      * @var string

+ 1 - 4
src/Fixer/Operator/StandardizeIncrementFixer.php

@@ -27,10 +27,7 @@ use PhpCsFixer\Tokenizer\Tokens;
  */
  */
 final class StandardizeIncrementFixer extends AbstractIncrementOperatorFixer
 final class StandardizeIncrementFixer extends AbstractIncrementOperatorFixer
 {
 {
-    /**
-     * @internal
-     */
-    public const EXPRESSION_END_TOKENS = [
+    private const EXPRESSION_END_TOKENS = [
         ';',
         ';',
         ')',
         ')',
         ']',
         ']',

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