From bdf2aef865e9d10b5ba6534e4f61d3600b594d22 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 2 Dec 2021 15:12:27 +0700 Subject: [PATCH 01/13] skip MyCLabsClassToEnumRector and SpatieEnumClassToEnumRector as needs syntax update usage and downgrade rule for it --- config/set/php81.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/set/php81.php b/config/set/php81.php index 6ba848f02a0..f541b21df71 100644 --- a/config/set/php81.php +++ b/config/set/php81.php @@ -17,11 +17,11 @@ return static function (ContainerConfigurator $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ReturnNeverTypeRector::class); - $services->set(MyCLabsClassToEnumRector::class); + //$services->set(MyCLabsClassToEnumRector::class); $services->set(MyCLabsMethodCallToEnumConstRector::class); $services->set(FinalizePublicClassConstantRector::class); $services->set(ReadOnlyPropertyRector::class); - $services->set(SpatieEnumClassToEnumRector::class); + //$services->set(SpatieEnumClassToEnumRector::class); $services->set(Php81ResourceReturnToObjectRector::class); $services->set(NewInInitializerRector::class); $services->set(IntersectionTypesRector::class); From 945c4eb851cc6d76a13c1f263a0209168ba8ce90 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 2 Dec 2021 10:56:38 +0000 Subject: [PATCH 02/13] [ci-review] Rector Rectify --- utils/compiler/src/PhpScoper/StaticEasyPrefixer.php | 2 +- utils/compiler/src/ValueObject/ScoperOption.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/utils/compiler/src/PhpScoper/StaticEasyPrefixer.php b/utils/compiler/src/PhpScoper/StaticEasyPrefixer.php index fe586933d21..168eab45f91 100644 --- a/utils/compiler/src/PhpScoper/StaticEasyPrefixer.php +++ b/utils/compiler/src/PhpScoper/StaticEasyPrefixer.php @@ -9,7 +9,7 @@ final class StaticEasyPrefixer /** * @var string[] */ - public const EXCLUDED_CLASSES = [ + final public const EXCLUDED_CLASSES = [ // part of public interface of configs.php 'Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator', // for SmartFileInfo diff --git a/utils/compiler/src/ValueObject/ScoperOption.php b/utils/compiler/src/ValueObject/ScoperOption.php index a3702a2217a..9fba9275103 100644 --- a/utils/compiler/src/ValueObject/ScoperOption.php +++ b/utils/compiler/src/ValueObject/ScoperOption.php @@ -12,25 +12,25 @@ final class ScoperOption /** * @var string */ - public const FINDERS = 'finders'; + final public const FINDERS = 'finders'; /** * @var string */ - public const PATCHERS = 'patchers'; + final public const PATCHERS = 'patchers'; /** * @var string */ - public const WHITELIST = 'whitelist'; + final public const WHITELIST = 'whitelist'; /** * @var string */ - public const FILES_WHITELIST = 'files-whitelist'; + final public const FILES_WHITELIST = 'files-whitelist'; /** * @var string */ - public const PREFIX = 'prefix'; + final public const PREFIX = 'prefix'; } From fb8b3f1d45856e80658473cc2316125a61814eab Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 2 Dec 2021 11:00:59 +0000 Subject: [PATCH 03/13] [ci-review] Rector Rectify --- .../Printer/PhpDocInfoPrinter.php | 2 +- .../DoctrineAnnotation/SilentKeyMap.php | 2 +- .../ValueObject/NodeTypes.php | 4 +- .../ValueObject/PhpDocAttributeKey.php | 10 +- packages/Caching/Enum/CacheKey.php | 6 +- .../Output/ConsoleOutputFormatter.php | 2 +- .../Output/JsonOutputFormatter.php | 2 +- .../Comments/NodeDocBlock/DocBlockUpdater.php | 2 +- .../ValueObject/EditorConfigOption.php | 10 +- packages/FileFormatter/ValueObject/Indent.php | 2 +- .../FileFormatter/ValueObject/NewLine.php | 6 +- .../ValueObject/ControlStructure.php | 6 +- .../NodeTypeResolver/Node/AttributeKey.php | 64 +++--- .../TypeMapper/ArrayTypeMapper.php | 2 +- .../TypeMapper/HasOffsetTypeMapper.php | 3 +- .../Application/ParallelFileProcessor.php | 2 +- packages/Parallel/ValueObject/Bridge.php | 10 +- packages/Parallel/ValueObject/Name.php | 12 +- .../Set/ValueObject/DowngradeLevelSetList.php | 22 +- packages/Set/ValueObject/DowngradeSetList.php | 22 +- packages/Set/ValueObject/LevelSetList.php | 20 +- packages/Set/ValueObject/SetList.php | 80 +++---- src/Application/VersionResolver.php | 4 +- src/Configuration/Option.php | 70 +++--- .../Rector/RenameClassNonPhpRector.php | 2 +- src/Template/DefaultResolver.php | 2 +- src/Validation/RectorAssert.php | 2 +- src/ValueObject/FrameworkName.php | 4 +- src/ValueObject/MethodName.php | 24 +- src/ValueObject/PhpVersion.php | 28 +-- src/ValueObject/PhpVersionFeature.php | 210 +++++++++--------- src/ValueObject/StaticNonPhpFileSuffixes.php | 2 +- src/ValueObject/Visibility.php | 14 +- 33 files changed, 326 insertions(+), 327 deletions(-) diff --git a/packages/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php b/packages/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php index c5586aa97ca..689d938516f 100644 --- a/packages/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php +++ b/packages/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php @@ -34,7 +34,7 @@ final class PhpDocInfoPrinter * @var string * @see https://regex101.com/r/Ab0Vey/1 */ - public const CLOSING_DOCBLOCK_REGEX = '#\*\/(\s+)?$#'; + final public const CLOSING_DOCBLOCK_REGEX = '#\*\/(\s+)?$#'; /** * @var string diff --git a/packages/BetterPhpDocParser/ValueObject/DoctrineAnnotation/SilentKeyMap.php b/packages/BetterPhpDocParser/ValueObject/DoctrineAnnotation/SilentKeyMap.php index 7709e836626..6f5208dba81 100644 --- a/packages/BetterPhpDocParser/ValueObject/DoctrineAnnotation/SilentKeyMap.php +++ b/packages/BetterPhpDocParser/ValueObject/DoctrineAnnotation/SilentKeyMap.php @@ -9,7 +9,7 @@ final class SilentKeyMap /** * @var array */ - public const CLASS_NAMES_TO_SILENT_KEYS = [ + final public const CLASS_NAMES_TO_SILENT_KEYS = [ 'Symfony\Component\Routing\Annotation\Route' => 'path', ]; } diff --git a/packages/BetterPhpDocParser/ValueObject/NodeTypes.php b/packages/BetterPhpDocParser/ValueObject/NodeTypes.php index 2c643c4e53a..a5539422969 100644 --- a/packages/BetterPhpDocParser/ValueObject/NodeTypes.php +++ b/packages/BetterPhpDocParser/ValueObject/NodeTypes.php @@ -17,7 +17,7 @@ final class NodeTypes /** * @var array> */ - public const TYPE_AWARE_NODES = [ + final public const TYPE_AWARE_NODES = [ VarTagValueNode::class, ParamTagValueNode::class, ReturnTagValueNode::class, @@ -29,7 +29,7 @@ final class NodeTypes /** * @var string[] */ - public const TYPE_AWARE_DOCTRINE_ANNOTATION_CLASSES = [ + final public const TYPE_AWARE_DOCTRINE_ANNOTATION_CLASSES = [ 'JMS\Serializer\Annotation\Type', 'Doctrine\ORM\Mapping\OneToMany', 'Symfony\Component\Validator\Constraints\Choice', diff --git a/packages/BetterPhpDocParser/ValueObject/PhpDocAttributeKey.php b/packages/BetterPhpDocParser/ValueObject/PhpDocAttributeKey.php index 15a46320b89..b9ee08528c1 100644 --- a/packages/BetterPhpDocParser/ValueObject/PhpDocAttributeKey.php +++ b/packages/BetterPhpDocParser/ValueObject/PhpDocAttributeKey.php @@ -11,26 +11,26 @@ final class PhpDocAttributeKey /** * @var string */ - public const START_AND_END = 'start_and_end'; + final public const START_AND_END = 'start_and_end'; /** * Fully qualified name of identifier type class * @var string */ - public const RESOLVED_CLASS = 'resolved_class'; + final public const RESOLVED_CLASS = 'resolved_class'; /** * @var string */ - public const PARENT = NativePhpDocAttributeKey::PARENT; + final public const PARENT = NativePhpDocAttributeKey::PARENT; /** * @var string */ - public const LAST_PHP_DOC_TOKEN_POSITION = 'last_token_position'; + final public const LAST_PHP_DOC_TOKEN_POSITION = 'last_token_position'; /** * @var string */ - public const ORIG_NODE = NativePhpDocAttributeKey::ORIG_NODE; + final public const ORIG_NODE = NativePhpDocAttributeKey::ORIG_NODE; } diff --git a/packages/Caching/Enum/CacheKey.php b/packages/Caching/Enum/CacheKey.php index df2194bb1d7..3e58c967976 100644 --- a/packages/Caching/Enum/CacheKey.php +++ b/packages/Caching/Enum/CacheKey.php @@ -12,15 +12,15 @@ final class CacheKey /** * @var string */ - public const CONFIGURATION_HASH_KEY = 'configuration_hash'; + final public const CONFIGURATION_HASH_KEY = 'configuration_hash'; /** * @var string */ - public const FILE_HASH_KEY = 'file_hash'; + final public const FILE_HASH_KEY = 'file_hash'; /** * @var string */ - public const DEPENDENT_FILES_KEY = 'dependency_files_key'; + final public const DEPENDENT_FILES_KEY = 'dependency_files_key'; } diff --git a/packages/ChangesReporting/Output/ConsoleOutputFormatter.php b/packages/ChangesReporting/Output/ConsoleOutputFormatter.php index c1fea4f16a9..3327deda7fa 100644 --- a/packages/ChangesReporting/Output/ConsoleOutputFormatter.php +++ b/packages/ChangesReporting/Output/ConsoleOutputFormatter.php @@ -18,7 +18,7 @@ final class ConsoleOutputFormatter implements OutputFormatterInterface /** * @var string */ - public const NAME = 'console'; + final public const NAME = 'console'; /** * @var string diff --git a/packages/ChangesReporting/Output/JsonOutputFormatter.php b/packages/ChangesReporting/Output/JsonOutputFormatter.php index 38360ded317..b27f30fbef6 100644 --- a/packages/ChangesReporting/Output/JsonOutputFormatter.php +++ b/packages/ChangesReporting/Output/JsonOutputFormatter.php @@ -15,7 +15,7 @@ final class JsonOutputFormatter implements OutputFormatterInterface /** * @var string */ - public const NAME = 'json'; + final public const NAME = 'json'; public function __construct( private readonly RectorsChangelogResolver $rectorsChangelogResolver diff --git a/packages/Comments/NodeDocBlock/DocBlockUpdater.php b/packages/Comments/NodeDocBlock/DocBlockUpdater.php index a12ef7312d9..d5dc91dea47 100644 --- a/packages/Comments/NodeDocBlock/DocBlockUpdater.php +++ b/packages/Comments/NodeDocBlock/DocBlockUpdater.php @@ -16,7 +16,7 @@ final class DocBlockUpdater * @var string * @see https://regex101.com/r/VdaVGL/1 */ - public const SPACE_OR_ASTERISK_REGEX = '#(\s|\*)+#'; + final public const SPACE_OR_ASTERISK_REGEX = '#(\s|\*)+#'; public function __construct( private readonly PhpDocInfoPrinter $phpDocInfoPrinter diff --git a/packages/FileFormatter/ValueObject/EditorConfigOption.php b/packages/FileFormatter/ValueObject/EditorConfigOption.php index 907e134c431..5fe55538039 100644 --- a/packages/FileFormatter/ValueObject/EditorConfigOption.php +++ b/packages/FileFormatter/ValueObject/EditorConfigOption.php @@ -9,25 +9,25 @@ final class EditorConfigOption /** * @var string */ - public const INDENT_STYLE = 'indent_style'; + final public const INDENT_STYLE = 'indent_style'; /** * @var string */ - public const INDENT_SIZE = 'indent_size'; + final public const INDENT_SIZE = 'indent_size'; /** * @var string */ - public const END_OF_LINE = 'end_of_line'; + final public const END_OF_LINE = 'end_of_line'; /** * @var string */ - public const INSERT_FINAL_NEWLINE = 'insert_final_newline'; + final public const INSERT_FINAL_NEWLINE = 'insert_final_newline'; /** * @var string */ - public const TAB_WIDTH = 'tab_width'; + final public const TAB_WIDTH = 'tab_width'; } diff --git a/packages/FileFormatter/ValueObject/Indent.php b/packages/FileFormatter/ValueObject/Indent.php index 4883704b186..1e551e8918f 100644 --- a/packages/FileFormatter/ValueObject/Indent.php +++ b/packages/FileFormatter/ValueObject/Indent.php @@ -19,7 +19,7 @@ final class Indent implements Stringable /** * @var array */ - public const CHARACTERS = [ + final public const CHARACTERS = [ self::SPACE => ' ', self::TAB => "\t", ]; diff --git a/packages/FileFormatter/ValueObject/NewLine.php b/packages/FileFormatter/ValueObject/NewLine.php index 2162536153c..967b994a2ad 100644 --- a/packages/FileFormatter/ValueObject/NewLine.php +++ b/packages/FileFormatter/ValueObject/NewLine.php @@ -17,17 +17,17 @@ final class NewLine implements Stringable /** * @var string */ - public const LINE_FEED = 'lf'; + final public const LINE_FEED = 'lf'; /** * @var string */ - public const CARRIAGE_RETURN = 'cr'; + final public const CARRIAGE_RETURN = 'cr'; /** * @var string */ - public const CARRIAGE_RETURN_LINE_FEED = 'crlf'; + final public const CARRIAGE_RETURN_LINE_FEED = 'crlf'; /** * @var array diff --git a/packages/NodeNestingScope/ValueObject/ControlStructure.php b/packages/NodeNestingScope/ValueObject/ControlStructure.php index a4a7db114fe..544ec2b9296 100644 --- a/packages/NodeNestingScope/ValueObject/ControlStructure.php +++ b/packages/NodeNestingScope/ValueObject/ControlStructure.php @@ -27,7 +27,7 @@ final class ControlStructure /** * @var array> */ - public const RETURN_ISOLATING_SCOPE_NODE_TYPES = [ + final public const RETURN_ISOLATING_SCOPE_NODE_TYPES = [ Function_::class, ClassMethod::class, Closure::class, @@ -37,7 +37,7 @@ final class ControlStructure /** * @var array> */ - public const BREAKING_SCOPE_NODE_TYPES = [ + final public const BREAKING_SCOPE_NODE_TYPES = [ For_::class, Foreach_::class, If_::class, @@ -54,7 +54,7 @@ final class ControlStructure * These situations happens only if condition is met * @var array> */ - public const CONDITIONAL_NODE_SCOPE_TYPES = [ + final public const CONDITIONAL_NODE_SCOPE_TYPES = [ If_::class, While_::class, Do_::class, diff --git a/packages/NodeTypeResolver/Node/AttributeKey.php b/packages/NodeTypeResolver/Node/AttributeKey.php index e1c0b24e48d..37fb7e0db89 100644 --- a/packages/NodeTypeResolver/Node/AttributeKey.php +++ b/packages/NodeTypeResolver/Node/AttributeKey.php @@ -15,18 +15,18 @@ final class AttributeKey /** * @var string */ - public const VIRTUAL_NODE = 'virtual_node'; + final public const VIRTUAL_NODE = 'virtual_node'; /** * @var string */ - public const SCOPE = 'scope'; + final public const SCOPE = 'scope'; /** * @deprecated * @var string */ - public const USE_NODES = 'useNodes'; + final public const USE_NODES = 'useNodes'; /** * @deprecated Use @@ -35,7 +35,7 @@ final class AttributeKey * * @var string */ - public const CLASS_NAME = 'className'; + final public const CLASS_NAME = 'className'; /** * @deprecated Use @@ -43,7 +43,7 @@ final class AttributeKey * * @var string */ - public const CLASS_NODE = 'class_node'; + final public const CLASS_NODE = 'class_node'; /** * @deprecated Use @@ -52,7 +52,7 @@ final class AttributeKey * * @var string */ - public const METHOD_NAME = 'methodName'; + final public const METHOD_NAME = 'methodName'; /** * @deprecated Use @@ -60,7 +60,7 @@ final class AttributeKey * * @var string */ - public const METHOD_NODE = 'methodNode'; + final public const METHOD_NODE = 'methodNode'; /** * Internal php-parser name. @@ -68,7 +68,7 @@ final class AttributeKey * * @var string */ - public const ORIGINAL_NODE = 'origNode'; + final public const ORIGINAL_NODE = 'origNode'; /** * Internal php-parser name. @@ -76,7 +76,7 @@ final class AttributeKey * * @var string */ - public const COMMENTS = 'comments'; + final public const COMMENTS = 'comments'; /** * Internal php-parser name. @@ -84,7 +84,7 @@ final class AttributeKey * * @var string */ - public const ORIGINAL_NAME = 'originalName'; + final public const ORIGINAL_NAME = 'originalName'; /** * Internal php-parser name. @see \PhpParser\NodeVisitor\NameResolver @@ -92,38 +92,38 @@ final class AttributeKey * * @var string */ - public const RESOLVED_NAME = 'resolvedName'; + final public const RESOLVED_NAME = 'resolvedName'; /** * @internal of php-parser, do not change * @see https://github.com/nikic/PHP-Parser/pull/681/files * @var string */ - public const PARENT_NODE = 'parent'; + final public const PARENT_NODE = 'parent'; /** * @internal of php-parser, do not change * @see https://github.com/nikic/PHP-Parser/pull/681/files * @var string */ - public const PREVIOUS_NODE = 'previous'; + final public const PREVIOUS_NODE = 'previous'; /** * @internal of php-parser, do not change * @see https://github.com/nikic/PHP-Parser/pull/681/files * @var string */ - public const NEXT_NODE = 'next'; + final public const NEXT_NODE = 'next'; /** * @var string */ - public const PREVIOUS_STATEMENT = 'previousExpression'; + final public const PREVIOUS_STATEMENT = 'previousExpression'; /** * @var string */ - public const CURRENT_STATEMENT = 'currentExpression'; + final public const CURRENT_STATEMENT = 'currentExpression'; /** * Internal php-parser name. @@ -131,7 +131,7 @@ final class AttributeKey * * @var string */ - public const NAMESPACED_NAME = 'namespacedName'; + final public const NAMESPACED_NAME = 'namespacedName'; /** * Internal php-parser name. @@ -139,7 +139,7 @@ final class AttributeKey * * @var string */ - public const DOC_INDENTATION = 'docIndentation'; + final public const DOC_INDENTATION = 'docIndentation'; /** * Internal php-parser name. @@ -147,48 +147,48 @@ final class AttributeKey * * @var string */ - public const START_TOKEN_POSITION = 'startTokenPos'; + final public const START_TOKEN_POSITION = 'startTokenPos'; /** * @var string * Use often in php-parser */ - public const KIND = 'kind'; + final public const KIND = 'kind'; /** * @var string */ - public const IS_UNREACHABLE = 'isUnreachable'; + final public const IS_UNREACHABLE = 'isUnreachable'; /** * @var string */ - public const PHP_DOC_INFO = 'php_doc_info'; + final public const PHP_DOC_INFO = 'php_doc_info'; /** * @var string */ - public const IS_REGULAR_PATTERN = 'is_regular_pattern'; + final public const IS_REGULAR_PATTERN = 'is_regular_pattern'; /** * @var string */ - public const DO_NOT_CHANGE = 'do_not_change'; + final public const DO_NOT_CHANGE = 'do_not_change'; /** * @var string */ - public const PARAMETER_POSITION = 'parameter_position'; + final public const PARAMETER_POSITION = 'parameter_position'; /** * @var string */ - public const ARGUMENT_POSITION = 'argument_position'; + final public const ARGUMENT_POSITION = 'argument_position'; /** * @var string */ - public const FUNC_ARGS_TRAILING_COMMA = 'trailing_comma'; + final public const FUNC_ARGS_TRAILING_COMMA = 'trailing_comma'; /** * Contains current file object @@ -196,28 +196,28 @@ final class AttributeKey * * @var string */ - public const FILE = 'file'; + final public const FILE = 'file'; /** * In case the php-doc info just changed, for reporting of changed nodes * @var string */ - public const HAS_PHP_DOC_INFO_JUST_CHANGED = 'has_php_doc_info_just_changed'; + final public const HAS_PHP_DOC_INFO_JUST_CHANGED = 'has_php_doc_info_just_changed'; /** * Helps with infinite loop detection * @var string */ - public const CREATED_BY_RULE = 'created_by_rule'; + final public const CREATED_BY_RULE = 'created_by_rule'; /** * Provided by PHPStan parser, depth in sense of nesting * @var string */ - public const STATEMENT_DEPTH = 'statementDepth'; + final public const STATEMENT_DEPTH = 'statementDepth'; /** * @var string */ - public const HAS_NEW_INHERITED_TYPE = 'has_new_inherited_type'; + final public const HAS_NEW_INHERITED_TYPE = 'has_new_inherited_type'; } diff --git a/packages/PHPStanStaticTypeMapper/TypeMapper/ArrayTypeMapper.php b/packages/PHPStanStaticTypeMapper/TypeMapper/ArrayTypeMapper.php index 2ae33a7ae81..281dddf0ce4 100644 --- a/packages/PHPStanStaticTypeMapper/TypeMapper/ArrayTypeMapper.php +++ b/packages/PHPStanStaticTypeMapper/TypeMapper/ArrayTypeMapper.php @@ -41,7 +41,7 @@ final class ArrayTypeMapper implements TypeMapperInterface /** * @var string */ - public const HAS_GENERIC_TYPE_PARENT = 'has_generic_type_parent'; + final public const HAS_GENERIC_TYPE_PARENT = 'has_generic_type_parent'; private PHPStanStaticTypeMapper $phpStanStaticTypeMapper; diff --git a/packages/PHPStanStaticTypeMapper/TypeMapper/HasOffsetTypeMapper.php b/packages/PHPStanStaticTypeMapper/TypeMapper/HasOffsetTypeMapper.php index ccd6e73be6c..acee2b2ad3f 100644 --- a/packages/PHPStanStaticTypeMapper/TypeMapper/HasOffsetTypeMapper.php +++ b/packages/PHPStanStaticTypeMapper/TypeMapper/HasOffsetTypeMapper.php @@ -4,7 +4,6 @@ namespace Rector\PHPStanStaticTypeMapper\TypeMapper; -use PhpParser\Node; use PHPStan\PhpDocParser\Ast\Type\ArrayTypeNode; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode; @@ -38,7 +37,7 @@ public function mapToPHPStanPhpDocTypeNode(Type $type, TypeKind $typeKind): Type /** * @param HasOffsetType $type */ - public function mapToPhpParserNode(Type $type, TypeKind $typeKind): ?Node + public function mapToPhpParserNode(Type $type, TypeKind $typeKind): never { throw new ShouldNotHappenException(); } diff --git a/packages/Parallel/Application/ParallelFileProcessor.php b/packages/Parallel/Application/ParallelFileProcessor.php index 41385f65b96..e9b0e4152c7 100644 --- a/packages/Parallel/Application/ParallelFileProcessor.php +++ b/packages/Parallel/Application/ParallelFileProcessor.php @@ -43,7 +43,7 @@ final class ParallelFileProcessor /** * @var int */ - public const TIMEOUT_IN_SECONDS = 60; + final public const TIMEOUT_IN_SECONDS = 60; /** * @var int diff --git a/packages/Parallel/ValueObject/Bridge.php b/packages/Parallel/ValueObject/Bridge.php index bc51e88a272..f40eee7b588 100644 --- a/packages/Parallel/ValueObject/Bridge.php +++ b/packages/Parallel/ValueObject/Bridge.php @@ -12,25 +12,25 @@ final class Bridge /** * @var string */ - public const FILE_DIFFS = 'file_diffs'; + final public const FILE_DIFFS = 'file_diffs'; /** * @var string */ - public const SYSTEM_ERRORS = 'system_errors'; + final public const SYSTEM_ERRORS = 'system_errors'; /** * @var string */ - public const SYSTEM_ERRORS_COUNT = 'system_errors_count'; + final public const SYSTEM_ERRORS_COUNT = 'system_errors_count'; /** * @var string */ - public const FILES = 'files'; + final public const FILES = 'files'; /** * @var string */ - public const FILES_COUNT = 'files_count'; + final public const FILES_COUNT = 'files_count'; } diff --git a/packages/Parallel/ValueObject/Name.php b/packages/Parallel/ValueObject/Name.php index aa6ccc35142..66344878827 100644 --- a/packages/Parallel/ValueObject/Name.php +++ b/packages/Parallel/ValueObject/Name.php @@ -12,30 +12,30 @@ final class Name /** * @var string */ - public const LINE = 'line'; + final public const LINE = 'line'; /** * @var string */ - public const MESSAGE = 'message'; + final public const MESSAGE = 'message'; /** * @var string */ - public const RELATIVE_FILE_PATH = 'relative_file_path'; + final public const RELATIVE_FILE_PATH = 'relative_file_path'; /** * @var string */ - public const DIFF = 'diff'; + final public const DIFF = 'diff'; /** * @var string */ - public const DIFF_CONSOLE_FORMATTED = 'diff_console_formatted'; + final public const DIFF_CONSOLE_FORMATTED = 'diff_console_formatted'; /** * @var string */ - public const APPLIED_RECTORS = 'applied_rectors'; + final public const APPLIED_RECTORS = 'applied_rectors'; } diff --git a/packages/Set/ValueObject/DowngradeLevelSetList.php b/packages/Set/ValueObject/DowngradeLevelSetList.php index 39c346e84b3..9d8a9a39fcf 100644 --- a/packages/Set/ValueObject/DowngradeLevelSetList.php +++ b/packages/Set/ValueObject/DowngradeLevelSetList.php @@ -11,55 +11,55 @@ final class DowngradeLevelSetList implements SetListInterface /** * @var string */ - public const DOWN_TO_PHP_80 = __DIR__ . '/../../../config/set/level/down-to-php80.php'; + final public const DOWN_TO_PHP_80 = __DIR__ . '/../../../config/set/level/down-to-php80.php'; /** * @var string */ - public const DOWN_TO_PHP_74 = __DIR__ . '/../../../config/set/level/down-to-php74.php'; + final public const DOWN_TO_PHP_74 = __DIR__ . '/../../../config/set/level/down-to-php74.php'; /** * @var string */ - public const DOWN_TO_PHP_73 = __DIR__ . '/../../../config/set/level/down-to-php73.php'; + final public const DOWN_TO_PHP_73 = __DIR__ . '/../../../config/set/level/down-to-php73.php'; /** * @var string */ - public const DOWN_TO_PHP_72 = __DIR__ . '/../../../config/set/level/down-to-php72.php'; + final public const DOWN_TO_PHP_72 = __DIR__ . '/../../../config/set/level/down-to-php72.php'; /** * @var string */ - public const DOWN_TO_PHP_71 = __DIR__ . '/../../../config/set/level/down-to-php71.php'; + final public const DOWN_TO_PHP_71 = __DIR__ . '/../../../config/set/level/down-to-php71.php'; /** * @var string */ - public const DOWN_TO_PHP_70 = __DIR__ . '/../../../config/set/level/down-to-php70.php'; + final public const DOWN_TO_PHP_70 = __DIR__ . '/../../../config/set/level/down-to-php70.php'; /** * @var string */ - public const DOWN_TO_PHP_56 = __DIR__ . '/../../../config/set/level/down-to-php56.php'; + final public const DOWN_TO_PHP_56 = __DIR__ . '/../../../config/set/level/down-to-php56.php'; /** * @var string */ - public const DOWN_TO_PHP_55 = __DIR__ . '/../../../config/set/level/down-to-php55.php'; + final public const DOWN_TO_PHP_55 = __DIR__ . '/../../../config/set/level/down-to-php55.php'; /** * @var string */ - public const DOWN_TO_PHP_54 = __DIR__ . '/../../../config/set/level/down-to-php54.php'; + final public const DOWN_TO_PHP_54 = __DIR__ . '/../../../config/set/level/down-to-php54.php'; /** * @var string */ - public const DOWN_TO_PHP_53 = __DIR__ . '/../../../config/set/level/down-to-php53.php'; + final public const DOWN_TO_PHP_53 = __DIR__ . '/../../../config/set/level/down-to-php53.php'; /** * @var string */ - public const DOWN_TO_PHP_52 = __DIR__ . '/../../../config/set/level/down-to-php52.php'; + final public const DOWN_TO_PHP_52 = __DIR__ . '/../../../config/set/level/down-to-php52.php'; } diff --git a/packages/Set/ValueObject/DowngradeSetList.php b/packages/Set/ValueObject/DowngradeSetList.php index b256cf8f31c..a9d449fbe08 100644 --- a/packages/Set/ValueObject/DowngradeSetList.php +++ b/packages/Set/ValueObject/DowngradeSetList.php @@ -11,55 +11,55 @@ final class DowngradeSetList implements SetListInterface /** * @var string */ - public const PHP_53 = __DIR__ . '/../../../config/set/downgrade-php53.php'; + final public const PHP_53 = __DIR__ . '/../../../config/set/downgrade-php53.php'; /** * @var string */ - public const PHP_54 = __DIR__ . '/../../../config/set/downgrade-php54.php'; + final public const PHP_54 = __DIR__ . '/../../../config/set/downgrade-php54.php'; /** * @var string */ - public const PHP_55 = __DIR__ . '/../../../config/set/downgrade-php55.php'; + final public const PHP_55 = __DIR__ . '/../../../config/set/downgrade-php55.php'; /** * @var string */ - public const PHP_56 = __DIR__ . '/../../../config/set/downgrade-php56.php'; + final public const PHP_56 = __DIR__ . '/../../../config/set/downgrade-php56.php'; /** * @var string */ - public const PHP_70 = __DIR__ . '/../../../config/set/downgrade-php70.php'; + final public const PHP_70 = __DIR__ . '/../../../config/set/downgrade-php70.php'; /** * @var string */ - public const PHP_71 = __DIR__ . '/../../../config/set/downgrade-php71.php'; + final public const PHP_71 = __DIR__ . '/../../../config/set/downgrade-php71.php'; /** * @var string */ - public const PHP_72 = __DIR__ . '/../../../config/set/downgrade-php72.php'; + final public const PHP_72 = __DIR__ . '/../../../config/set/downgrade-php72.php'; /** * @var string */ - public const PHP_73 = __DIR__ . '/../../../config/set/downgrade-php73.php'; + final public const PHP_73 = __DIR__ . '/../../../config/set/downgrade-php73.php'; /** * @var string */ - public const PHP_74 = __DIR__ . '/../../../config/set/downgrade-php74.php'; + final public const PHP_74 = __DIR__ . '/../../../config/set/downgrade-php74.php'; /** * @var string */ - public const PHP_80 = __DIR__ . '/../../../config/set/downgrade-php80.php'; + final public const PHP_80 = __DIR__ . '/../../../config/set/downgrade-php80.php'; /** * @var string */ - public const PHP_81 = __DIR__ . '/../../../config/set/downgrade-php81.php'; + final public const PHP_81 = __DIR__ . '/../../../config/set/downgrade-php81.php'; } diff --git a/packages/Set/ValueObject/LevelSetList.php b/packages/Set/ValueObject/LevelSetList.php index 64c417d7e36..55ab5161c65 100644 --- a/packages/Set/ValueObject/LevelSetList.php +++ b/packages/Set/ValueObject/LevelSetList.php @@ -11,50 +11,50 @@ final class LevelSetList implements SetListInterface /** * @var string */ - public const UP_TO_PHP_81 = __DIR__ . '/../../../config/set/level/up-to-php81.php'; + final public const UP_TO_PHP_81 = __DIR__ . '/../../../config/set/level/up-to-php81.php'; /** * @var string */ - public const UP_TO_PHP_80 = __DIR__ . '/../../../config/set/level/up-to-php80.php'; + final public const UP_TO_PHP_80 = __DIR__ . '/../../../config/set/level/up-to-php80.php'; /** * @var string */ - public const UP_TO_PHP_74 = __DIR__ . '/../../../config/set/level/up-to-php74.php'; + final public const UP_TO_PHP_74 = __DIR__ . '/../../../config/set/level/up-to-php74.php'; /** * @var string */ - public const UP_TO_PHP_73 = __DIR__ . '/../../../config/set/level/up-to-php73.php'; + final public const UP_TO_PHP_73 = __DIR__ . '/../../../config/set/level/up-to-php73.php'; /** * @var string */ - public const UP_TO_PHP_72 = __DIR__ . '/../../../config/set/level/up-to-php72.php'; + final public const UP_TO_PHP_72 = __DIR__ . '/../../../config/set/level/up-to-php72.php'; /** * @var string */ - public const UP_TO_PHP_71 = __DIR__ . '/../../../config/set/level/up-to-php71.php'; + final public const UP_TO_PHP_71 = __DIR__ . '/../../../config/set/level/up-to-php71.php'; /** * @var string */ - public const UP_TO_PHP_70 = __DIR__ . '/../../../config/set/level/up-to-php70.php'; + final public const UP_TO_PHP_70 = __DIR__ . '/../../../config/set/level/up-to-php70.php'; /** * @var string */ - public const UP_TO_PHP_56 = __DIR__ . '/../../../config/set/level/up-to-php56.php'; + final public const UP_TO_PHP_56 = __DIR__ . '/../../../config/set/level/up-to-php56.php'; /** * @var string */ - public const UP_TO_PHP_55 = __DIR__ . '/../../../config/set/level/up-to-php55.php'; + final public const UP_TO_PHP_55 = __DIR__ . '/../../../config/set/level/up-to-php55.php'; /** * @var string */ - public const UP_TO_PHP_54 = __DIR__ . '/../../../config/set/level/up-to-php54.php'; + final public const UP_TO_PHP_54 = __DIR__ . '/../../../config/set/level/up-to-php54.php'; } diff --git a/packages/Set/ValueObject/SetList.php b/packages/Set/ValueObject/SetList.php index 67dbad94a27..5892058cee2 100644 --- a/packages/Set/ValueObject/SetList.php +++ b/packages/Set/ValueObject/SetList.php @@ -12,202 +12,202 @@ final class SetList implements SetListInterface /** * @var string */ - public const DEFLUENT = __DIR__ . '/../../../config/set/defluent.php'; + final public const DEFLUENT = __DIR__ . '/../../../config/set/defluent.php'; /** * @var string */ - public const ACTION_INJECTION_TO_CONSTRUCTOR_INJECTION = __DIR__ . '/../../../config/set/action-injection-to-constructor-injection.php'; + final public const ACTION_INJECTION_TO_CONSTRUCTOR_INJECTION = __DIR__ . '/../../../config/set/action-injection-to-constructor-injection.php'; /** * @var string */ - public const CODE_QUALITY = __DIR__ . '/../../../config/set/code-quality.php'; + final public const CODE_QUALITY = __DIR__ . '/../../../config/set/code-quality.php'; /** * @deprecated Use only/directly CODE_QUALITY instead * @var string */ - public const CODE_QUALITY_STRICT = __DIR__ . '/../../../config/set/code-quality-strict.php'; + final public const CODE_QUALITY_STRICT = __DIR__ . '/../../../config/set/code-quality-strict.php'; /** * @var string */ - public const CODING_STYLE = __DIR__ . '/../../../config/set/coding-style.php'; + final public const CODING_STYLE = __DIR__ . '/../../../config/set/coding-style.php'; /** * @var string */ - public const CODING_STYLE_ADVANCED = __DIR__ . '/../../../config/set/coding-style-advanced.php'; + final public const CODING_STYLE_ADVANCED = __DIR__ . '/../../../config/set/coding-style-advanced.php'; /** * @var string */ - public const DEAD_CODE = __DIR__ . '/../../../config/set/dead-code.php'; + final public const DEAD_CODE = __DIR__ . '/../../../config/set/dead-code.php'; /** * @var string */ - public const FLYSYSTEM_20 = __DIR__ . '/../../../config/set/flysystem-20.php'; + final public const FLYSYSTEM_20 = __DIR__ . '/../../../config/set/flysystem-20.php'; /** * @var string */ - public const FRAMEWORK_EXTRA_BUNDLE_40 = __DIR__ . '/../../../config/set/framework-extra-bundle-40.php'; + final public const FRAMEWORK_EXTRA_BUNDLE_40 = __DIR__ . '/../../../config/set/framework-extra-bundle-40.php'; /** * @var string */ - public const FRAMEWORK_EXTRA_BUNDLE_50 = __DIR__ . '/../../../config/set/framework-extra-bundle-50.php'; + final public const FRAMEWORK_EXTRA_BUNDLE_50 = __DIR__ . '/../../../config/set/framework-extra-bundle-50.php'; /** * @var string */ - public const GMAGICK_TO_IMAGICK = __DIR__ . '/../../../config/set/gmagick_to_imagick.php'; + final public const GMAGICK_TO_IMAGICK = __DIR__ . '/../../../config/set/gmagick_to_imagick.php'; /** * @var string */ - public const MONOLOG_20 = __DIR__ . '/../../../config/set/monolog20.php'; + final public const MONOLOG_20 = __DIR__ . '/../../../config/set/monolog20.php'; /** * @var string */ - public const MYSQL_TO_MYSQLI = __DIR__ . '/../../../config/set/mysql-to-mysqli.php'; + final public const MYSQL_TO_MYSQLI = __DIR__ . '/../../../config/set/mysql-to-mysqli.php'; /** * @var string */ - public const NAMING = __DIR__ . '/../../../config/set/naming.php'; + final public const NAMING = __DIR__ . '/../../../config/set/naming.php'; /** * @var string */ - public const ORDER = __DIR__ . '/../../../config/set/order.php'; + final public const ORDER = __DIR__ . '/../../../config/set/order.php'; /** * @var string */ - public const PHALCON_40 = __DIR__ . '/../../../config/set/phalcon40.php'; + final public const PHALCON_40 = __DIR__ . '/../../../config/set/phalcon40.php'; /** * @var string * @deprecated Use PHPOfficeSetList class instead */ - public const PHPEXCEL_TO_PHPSPREADSHEET = PHPOfficeSetList::PHPEXCEL_TO_PHPSPREADSHEET; + final public const PHPEXCEL_TO_PHPSPREADSHEET = PHPOfficeSetList::PHPEXCEL_TO_PHPSPREADSHEET; /** * @var string */ - public const PHPSPEC_30 = __DIR__ . '/../../../config/set/phpspec30.php'; + final public const PHPSPEC_30 = __DIR__ . '/../../../config/set/phpspec30.php'; /** * @var string */ - public const PHPSPEC_40 = __DIR__ . '/../../../config/set/phpspec40.php'; + final public const PHPSPEC_40 = __DIR__ . '/../../../config/set/phpspec40.php'; /** * @var string */ - public const PHPSPEC_TO_PHPUNIT = __DIR__ . '/../../../config/set/phpspec-to-phpunit.php'; + final public const PHPSPEC_TO_PHPUNIT = __DIR__ . '/../../../config/set/phpspec-to-phpunit.php'; /** * @var string */ - public const PHP_52 = __DIR__ . '/../../../config/set/php52.php'; + final public const PHP_52 = __DIR__ . '/../../../config/set/php52.php'; /** * @var string */ - public const PHP_53 = __DIR__ . '/../../../config/set/php53.php'; + final public const PHP_53 = __DIR__ . '/../../../config/set/php53.php'; /** * @var string */ - public const PHP_54 = __DIR__ . '/../../../config/set/php54.php'; + final public const PHP_54 = __DIR__ . '/../../../config/set/php54.php'; /** * @var string */ - public const PHP_55 = __DIR__ . '/../../../config/set/php55.php'; + final public const PHP_55 = __DIR__ . '/../../../config/set/php55.php'; /** * @var string */ - public const PHP_56 = __DIR__ . '/../../../config/set/php56.php'; + final public const PHP_56 = __DIR__ . '/../../../config/set/php56.php'; /** * @var string */ - public const PHP_70 = __DIR__ . '/../../../config/set/php70.php'; + final public const PHP_70 = __DIR__ . '/../../../config/set/php70.php'; /** * @var string */ - public const PHP_71 = __DIR__ . '/../../../config/set/php71.php'; + final public const PHP_71 = __DIR__ . '/../../../config/set/php71.php'; /** * @var string */ - public const PHP_72 = __DIR__ . '/../../../config/set/php72.php'; + final public const PHP_72 = __DIR__ . '/../../../config/set/php72.php'; /** * @var string */ - public const PHP_73 = __DIR__ . '/../../../config/set/php73.php'; + final public const PHP_73 = __DIR__ . '/../../../config/set/php73.php'; /** * @var string */ - public const PHP_74 = __DIR__ . '/../../../config/set/php74.php'; + final public const PHP_74 = __DIR__ . '/../../../config/set/php74.php'; /** * @var string */ - public const PHP_80 = __DIR__ . '/../../../config/set/php80.php'; + final public const PHP_80 = __DIR__ . '/../../../config/set/php80.php'; /** * @var string */ - public const PHP_81 = __DIR__ . '/../../../config/set/php81.php'; + final public const PHP_81 = __DIR__ . '/../../../config/set/php81.php'; /** * @var string */ - public const PRIVATIZATION = __DIR__ . '/../../../config/set/privatization.php'; + final public const PRIVATIZATION = __DIR__ . '/../../../config/set/privatization.php'; /** * @var string */ - public const PSR_4 = __DIR__ . '/../../../config/set/psr-4.php'; + final public const PSR_4 = __DIR__ . '/../../../config/set/psr-4.php'; /** * @var string */ - public const SAFE_07 = __DIR__ . '/../../../config/set/safe07.php'; + final public const SAFE_07 = __DIR__ . '/../../../config/set/safe07.php'; /** * @var string */ - public const TYPE_DECLARATION = __DIR__ . '/../../../config/set/type-declaration.php'; + final public const TYPE_DECLARATION = __DIR__ . '/../../../config/set/type-declaration.php'; /** * @var string */ - public const TYPE_DECLARATION_STRICT = __DIR__ . '/../../../config/set/type-declaration-strict.php'; + final public const TYPE_DECLARATION_STRICT = __DIR__ . '/../../../config/set/type-declaration-strict.php'; /** * @var string */ - public const UNWRAP_COMPAT = __DIR__ . '/../../../config/set/unwrap-compat.php'; + final public const UNWRAP_COMPAT = __DIR__ . '/../../../config/set/unwrap-compat.php'; /** * @var string */ - public const EARLY_RETURN = __DIR__ . '/../../../config/set/early-return.php'; + final public const EARLY_RETURN = __DIR__ . '/../../../config/set/early-return.php'; /** * @var string */ - public const CARBON_2 = __DIR__ . '/../../../config/set/carbon-2.php'; + final public const CARBON_2 = __DIR__ . '/../../../config/set/carbon-2.php'; } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index f46cb72c50e..641700940cf 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -18,12 +18,12 @@ final class VersionResolver /** * @var string */ - public const PACKAGE_VERSION = '@package_version@'; + final public const PACKAGE_VERSION = '@package_version@'; /** * @var string */ - public const RELEASE_DATE = '@release_date@'; + final public const RELEASE_DATE = '@release_date@'; public static function resolvePackageVersion(): string { diff --git a/src/Configuration/Option.php b/src/Configuration/Option.php index d7708d071ed..064d602aad3 100644 --- a/src/Configuration/Option.php +++ b/src/Configuration/Option.php @@ -15,108 +15,108 @@ final class Option /** * @var string */ - public const SOURCE = 'source'; + final public const SOURCE = 'source'; /** * @var string */ - public const AUTOLOAD_FILE = 'autoload-file'; + final public const AUTOLOAD_FILE = 'autoload-file'; /** * @var string */ - public const BOOTSTRAP_FILES = 'bootstrap_files'; + final public const BOOTSTRAP_FILES = 'bootstrap_files'; /** * @var string */ - public const DRY_RUN = 'dry-run'; + final public const DRY_RUN = 'dry-run'; /** * @var string */ - public const DRY_RUN_SHORT = 'n'; + final public const DRY_RUN_SHORT = 'n'; /** * @var string */ - public const OUTPUT_FORMAT = 'output-format'; + final public const OUTPUT_FORMAT = 'output-format'; /** * @var string */ - public const NO_PROGRESS_BAR = 'no-progress-bar'; + final public const NO_PROGRESS_BAR = 'no-progress-bar'; /** * @var string */ - public const PHP_VERSION_FEATURES = 'php_version_features'; + final public const PHP_VERSION_FEATURES = 'php_version_features'; /** * @var string */ - public const AUTO_IMPORT_NAMES = 'auto_import_names'; + final public const AUTO_IMPORT_NAMES = 'auto_import_names'; /** * @var string */ - public const IMPORT_SHORT_CLASSES = 'import_short_classes'; + final public const IMPORT_SHORT_CLASSES = 'import_short_classes'; /** * @var string */ - public const IMPORT_DOC_BLOCKS = 'import_doc_blocks'; + final public const IMPORT_DOC_BLOCKS = 'import_doc_blocks'; /** * @var string */ - public const SYMFONY_CONTAINER_XML_PATH_PARAMETER = 'symfony_container_xml_path'; + final public const SYMFONY_CONTAINER_XML_PATH_PARAMETER = 'symfony_container_xml_path'; /** * @var string */ - public const CLEAR_CACHE = 'clear-cache'; + final public const CLEAR_CACHE = 'clear-cache'; /** * @var string */ - public const PARALLEL = 'parallel'; + final public const PARALLEL = 'parallel'; /** * @deprecated Cache is enabled by default * @var string */ - public const ENABLE_CACHE = 'enable_cache'; + final public const ENABLE_CACHE = 'enable_cache'; /** * @var string */ - public const PATHS = 'paths'; + final public const PATHS = 'paths'; /** * @var string */ - public const AUTOLOAD_PATHS = 'autoload_paths'; + final public const AUTOLOAD_PATHS = 'autoload_paths'; /** * @var string */ - public const SKIP = SkipperOption::SKIP; + final public const SKIP = SkipperOption::SKIP; /** * @var string */ - public const FILE_EXTENSIONS = 'file_extensions'; + final public const FILE_EXTENSIONS = 'file_extensions'; /** * @var string */ - public const NESTED_CHAIN_METHOD_CALL_LIMIT = 'nested_chain_method_call_limit'; + final public const NESTED_CHAIN_METHOD_CALL_LIMIT = 'nested_chain_method_call_limit'; /** * @var string */ - public const CACHE_DIR = 'cache_dir'; + final public const CACHE_DIR = 'cache_dir'; /** * Cache backend. Most of the time we cache in files, but in ephemeral environment (e.g. CI), a faster `MemoryCacheStorage` can be usefull. @@ -124,70 +124,70 @@ final class Option * @var class-string * @internal */ - public const CACHE_CLASS = FileCacheStorage::class; + final public const CACHE_CLASS = FileCacheStorage::class; /** * @var string */ - public const DEBUG = 'debug'; + final public const DEBUG = 'debug'; /** * @var string */ - public const XDEBUG = 'xdebug'; + final public const XDEBUG = 'xdebug'; /** * @var string */ - public const CONFIG = 'config'; + final public const CONFIG = 'config'; /** * @var string */ - public const PHPSTAN_FOR_RECTOR_PATH = 'phpstan_for_rector_path'; + final public const PHPSTAN_FOR_RECTOR_PATH = 'phpstan_for_rector_path'; /** * @var string */ - public const TYPES_TO_REMOVE_STATIC_FROM = 'types_to_remove_static_from'; + final public const TYPES_TO_REMOVE_STATIC_FROM = 'types_to_remove_static_from'; /** * @var string */ - public const NO_DIFFS = 'no-diffs'; + final public const NO_DIFFS = 'no-diffs'; /** * @var string */ - public const TEMPLATE_TYPE = 'template-type'; + final public const TEMPLATE_TYPE = 'template-type'; /** * @var string */ - public const ENABLE_EDITORCONFIG = 'enable_editorconfig'; + final public const ENABLE_EDITORCONFIG = 'enable_editorconfig'; /** * @var string */ - public const AUTOLOAD_FILE_SHORT = 'a'; + final public const AUTOLOAD_FILE_SHORT = 'a'; /** * @var string */ - public const OUTPUT_FORMAT_SHORT = 'o'; + final public const OUTPUT_FORMAT_SHORT = 'o'; /** * @var string */ - public const APPLY_AUTO_IMPORT_NAMES_ON_CHANGED_FILES_ONLY = 'apply_auto_import_names_on_changed_files_only'; + final public const APPLY_AUTO_IMPORT_NAMES_ON_CHANGED_FILES_ONLY = 'apply_auto_import_names_on_changed_files_only'; /** * @var string */ - public const PARALLEL_IDENTIFIER = 'identifier'; + final public const PARALLEL_IDENTIFIER = 'identifier'; /** * @var string */ - public const PARALLEL_PORT = 'port'; + final public const PARALLEL_PORT = 'port'; } diff --git a/src/NonPhpFile/Rector/RenameClassNonPhpRector.php b/src/NonPhpFile/Rector/RenameClassNonPhpRector.php index 7fa7c28e5df..a09c9bb076c 100644 --- a/src/NonPhpFile/Rector/RenameClassNonPhpRector.php +++ b/src/NonPhpFile/Rector/RenameClassNonPhpRector.php @@ -19,7 +19,7 @@ final class RenameClassNonPhpRector implements NonPhpRectorInterface, Configurab /** * @var string */ - public const RENAME_CLASSES = 'rename_classes'; + final public const RENAME_CLASSES = 'rename_classes'; /** * @see https://regex101.com/r/HKUFJD/7 diff --git a/src/Template/DefaultResolver.php b/src/Template/DefaultResolver.php index 2a926ed4063..e154ff08dd7 100644 --- a/src/Template/DefaultResolver.php +++ b/src/Template/DefaultResolver.php @@ -11,7 +11,7 @@ final class DefaultResolver implements TemplateResolverInterface /** * @var string */ - public const TYPE = 'default'; + final public const TYPE = 'default'; public function provide(): string { diff --git a/src/Validation/RectorAssert.php b/src/Validation/RectorAssert.php index 6707449d0da..57dad453845 100644 --- a/src/Validation/RectorAssert.php +++ b/src/Validation/RectorAssert.php @@ -17,7 +17,7 @@ final class RectorAssert * @see https://regex101.com/r/PYQaPF/1 * @var string */ - public const CLASS_NAME_REGEX = '#^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\\\\[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)*$#'; + final public const CLASS_NAME_REGEX = '#^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\\\\[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)*$#'; /** * Assert value is valid class name diff --git a/src/ValueObject/FrameworkName.php b/src/ValueObject/FrameworkName.php index ea77c49f198..95db2e0bd79 100644 --- a/src/ValueObject/FrameworkName.php +++ b/src/ValueObject/FrameworkName.php @@ -12,10 +12,10 @@ final class FrameworkName /** * @var string */ - public const NETTE = 'nette'; + final public const NETTE = 'nette'; /** * @var string */ - public const SYMFONY = 'symfony'; + final public const SYMFONY = 'symfony'; } diff --git a/src/ValueObject/MethodName.php b/src/ValueObject/MethodName.php index 967ef6183cf..1923e6a7cec 100644 --- a/src/ValueObject/MethodName.php +++ b/src/ValueObject/MethodName.php @@ -12,64 +12,64 @@ final class MethodName /** * @var string */ - public const __SET = '__set'; + final public const __SET = '__set'; /** * @var string */ - public const __GET = '__get'; + final public const __GET = '__get'; /** * @var string */ - public const CONSTRUCT = '__construct'; + final public const CONSTRUCT = '__construct'; /** * @var string */ - public const DESCTRUCT = '__destruct'; + final public const DESCTRUCT = '__destruct'; /** * @var string */ - public const CLONE = '__clone'; + final public const CLONE = '__clone'; /** * Mostly used in unit tests * @see https://phpunit.readthedocs.io/en/9.3/fixtures.html#more-setup-than-teardown * @var string */ - public const SET_UP = 'setUp'; + final public const SET_UP = 'setUp'; /** * Mostly used in unit tests * @var string */ - public const TEAR_DOWN = 'tearDown'; + final public const TEAR_DOWN = 'tearDown'; /** * @var string */ - public const SET_STATE = '__set_state'; + final public const SET_STATE = '__set_state'; /** * @see https://phpunit.readthedocs.io/en/9.3/fixtures.html#fixtures-sharing-fixture-examples-databasetest-php * @var string */ - public const SET_UP_BEFORE_CLASS = 'setUpBeforeClass'; + final public const SET_UP_BEFORE_CLASS = 'setUpBeforeClass'; /** * @var string */ - public const CALL = '__call'; + final public const CALL = '__call'; /** * @var string */ - public const TO_STRING = '__toString'; + final public const TO_STRING = '__toString'; /** * @var string */ - public const INVOKE = '__invoke'; + final public const INVOKE = '__invoke'; } diff --git a/src/ValueObject/PhpVersion.php b/src/ValueObject/PhpVersion.php index 6efe986c2fc..6289ec8841f 100644 --- a/src/ValueObject/PhpVersion.php +++ b/src/ValueObject/PhpVersion.php @@ -12,83 +12,83 @@ final class PhpVersion extends Enum * @api * @var int */ - public const PHP_52 = 50200; + final public const PHP_52 = 50200; /** * @api * @var int */ - public const PHP_53 = 50300; + final public const PHP_53 = 50300; /** * @api * @var int */ - public const PHP_54 = 50400; + final public const PHP_54 = 50400; /** * @api * @var int */ - public const PHP_55 = 50500; + final public const PHP_55 = 50500; /** * @api * @var int */ - public const PHP_56 = 50600; + final public const PHP_56 = 50600; /** * @api * @var int */ - public const PHP_70 = 70000; + final public const PHP_70 = 70000; /** * @api * @var int */ - public const PHP_71 = 70100; + final public const PHP_71 = 70100; /** * @api * @var int */ - public const PHP_72 = 70200; + final public const PHP_72 = 70200; /** * @api * @var int */ - public const PHP_73 = 70300; + final public const PHP_73 = 70300; /** * @api * @var int */ - public const PHP_74 = 70400; + final public const PHP_74 = 70400; /** * @api * @var int */ - public const PHP_80 = 80000; + final public const PHP_80 = 80000; /** * @api * @var int */ - public const PHP_81 = 80100; + final public const PHP_81 = 80100; /** * @api * @var int */ - public const PHP_82 = 80200; + final public const PHP_82 = 80200; /** * @api * @var int */ - public const PHP_10 = 100000; + final public const PHP_10 = 100000; } diff --git a/src/ValueObject/PhpVersionFeature.php b/src/ValueObject/PhpVersionFeature.php index 8212bfe786f..cad2eafa606 100644 --- a/src/ValueObject/PhpVersionFeature.php +++ b/src/ValueObject/PhpVersionFeature.php @@ -9,53 +9,53 @@ final class PhpVersionFeature /** * @var int */ - public const PROPERTY_MODIFIER = PhpVersion::PHP_52; + final public const PROPERTY_MODIFIER = PhpVersion::PHP_52; /** * @var int */ - public const CONTINUE_TO_BREAK = PhpVersion::PHP_52; + final public const CONTINUE_TO_BREAK = PhpVersion::PHP_52; /** * @var int */ - public const NO_REFERENCE_IN_NEW = PhpVersion::PHP_53; + final public const NO_REFERENCE_IN_NEW = PhpVersion::PHP_53; /** * @var int */ - public const SERVER_VAR = PhpVersion::PHP_53; + final public const SERVER_VAR = PhpVersion::PHP_53; /** * @var int */ - public const DIR_CONSTANT = PhpVersion::PHP_53; + final public const DIR_CONSTANT = PhpVersion::PHP_53; /** * @var int */ - public const ELVIS_OPERATOR = PhpVersion::PHP_53; + final public const ELVIS_OPERATOR = PhpVersion::PHP_53; /** * @var int */ - public const NO_ZERO_BREAK = PhpVersion::PHP_54; + final public const NO_ZERO_BREAK = PhpVersion::PHP_54; /** * @var int */ - public const NO_REFERENCE_IN_ARG = PhpVersion::PHP_54; + final public const NO_REFERENCE_IN_ARG = PhpVersion::PHP_54; /** * @var int */ - public const DATE_TIME_INTERFACE = PhpVersion::PHP_55; + final public const DATE_TIME_INTERFACE = PhpVersion::PHP_55; /** * @see https://wiki.php.net/rfc/class_name_scalars * @var int */ - public const CLASSNAME_CONSTANT = PhpVersion::PHP_55; + final public const CLASSNAME_CONSTANT = PhpVersion::PHP_55; /* * @var int @@ -64,92 +64,92 @@ final class PhpVersionFeature /** * @var int */ - public const PREG_REPLACE_CALLBACK_E_MODIFIER = PhpVersion::PHP_55; + final public const PREG_REPLACE_CALLBACK_E_MODIFIER = PhpVersion::PHP_55; /** * @var int */ - public const EXP_OPERATOR = PhpVersion::PHP_56; + final public const EXP_OPERATOR = PhpVersion::PHP_56; /** * @var int */ - public const REQUIRE_DEFAULT_VALUE = PhpVersion::PHP_56; + final public const REQUIRE_DEFAULT_VALUE = PhpVersion::PHP_56; /** * @var int */ - public const SCALAR_TYPES = PhpVersion::PHP_70; + final public const SCALAR_TYPES = PhpVersion::PHP_70; /** * @var int */ - public const NULL_COALESCE = PhpVersion::PHP_70; + final public const NULL_COALESCE = PhpVersion::PHP_70; /** * @var int */ - public const LIST_SWAP_ORDER = PhpVersion::PHP_70; + final public const LIST_SWAP_ORDER = PhpVersion::PHP_70; /** * @var int */ - public const SPACESHIP = PhpVersion::PHP_70; + final public const SPACESHIP = PhpVersion::PHP_70; /** * @var int */ - public const DIRNAME_LEVELS = PhpVersion::PHP_70; + final public const DIRNAME_LEVELS = PhpVersion::PHP_70; /** * @var int */ - public const CSPRNG_FUNCTIONS = PhpVersion::PHP_70; + final public const CSPRNG_FUNCTIONS = PhpVersion::PHP_70; /** * @var int */ - public const THROWABLE_TYPE = PhpVersion::PHP_70; + final public const THROWABLE_TYPE = PhpVersion::PHP_70; /** * @var int */ - public const NO_LIST_SPLIT_STRING = PhpVersion::PHP_70; + final public const NO_LIST_SPLIT_STRING = PhpVersion::PHP_70; /** * @var int */ - public const NO_BREAK_OUTSIDE_LOOP = PhpVersion::PHP_70; + final public const NO_BREAK_OUTSIDE_LOOP = PhpVersion::PHP_70; /** * @var int */ - public const NO_PHP4_CONSTRUCTOR = PhpVersion::PHP_70; + final public const NO_PHP4_CONSTRUCTOR = PhpVersion::PHP_70; /** * @var int */ - public const NO_CALL_USER_METHOD = PhpVersion::PHP_70; + final public const NO_CALL_USER_METHOD = PhpVersion::PHP_70; /** * @var int */ - public const NO_EREG_FUNCTION = PhpVersion::PHP_70; + final public const NO_EREG_FUNCTION = PhpVersion::PHP_70; /** * @var int */ - public const VARIABLE_ON_FUNC_CALL = PhpVersion::PHP_70; + final public const VARIABLE_ON_FUNC_CALL = PhpVersion::PHP_70; /** * @var int */ - public const NO_MKTIME_WITHOUT_ARG = PhpVersion::PHP_70; + final public const NO_MKTIME_WITHOUT_ARG = PhpVersion::PHP_70; /** * @var int */ - public const NO_EMPTY_LIST = PhpVersion::PHP_70; + final public const NO_EMPTY_LIST = PhpVersion::PHP_70; /** * @see https://php.watch/versions/8.0/non-static-static-call-fatal-error @@ -157,401 +157,401 @@ final class PhpVersionFeature * * @var int */ - public const STATIC_CALL_ON_NON_STATIC = PhpVersion::PHP_70; + final public const STATIC_CALL_ON_NON_STATIC = PhpVersion::PHP_70; /** * @var int */ - public const INSTANCE_CALL = PhpVersion::PHP_70; + final public const INSTANCE_CALL = PhpVersion::PHP_70; /** * @var int */ - public const NO_MULTIPLE_DEFAULT_SWITCH = PhpVersion::PHP_70; + final public const NO_MULTIPLE_DEFAULT_SWITCH = PhpVersion::PHP_70; /** * @var int */ - public const WRAP_VARIABLE_VARIABLE = PhpVersion::PHP_70; + final public const WRAP_VARIABLE_VARIABLE = PhpVersion::PHP_70; /** * @var int */ - public const ITERABLE_TYPE = PhpVersion::PHP_71; + final public const ITERABLE_TYPE = PhpVersion::PHP_71; /** * @var int */ - public const VOID_TYPE = PhpVersion::PHP_71; + final public const VOID_TYPE = PhpVersion::PHP_71; /** * @var int */ - public const CONSTANT_VISIBILITY = PhpVersion::PHP_71; + final public const CONSTANT_VISIBILITY = PhpVersion::PHP_71; /** * @var int */ - public const ARRAY_DESTRUCT = PhpVersion::PHP_71; + final public const ARRAY_DESTRUCT = PhpVersion::PHP_71; /** * @var int */ - public const MULTI_EXCEPTION_CATCH = PhpVersion::PHP_71; + final public const MULTI_EXCEPTION_CATCH = PhpVersion::PHP_71; /** * @var int */ - public const NO_ASSIGN_ARRAY_TO_STRING = PhpVersion::PHP_71; + final public const NO_ASSIGN_ARRAY_TO_STRING = PhpVersion::PHP_71; /** * @var int */ - public const BINARY_OP_NUMBER_STRING = PhpVersion::PHP_71; + final public const BINARY_OP_NUMBER_STRING = PhpVersion::PHP_71; /** * @var int */ - public const NO_EXTRA_PARAMETERS = PhpVersion::PHP_71; + final public const NO_EXTRA_PARAMETERS = PhpVersion::PHP_71; /** * @var int */ - public const RESERVED_OBJECT_KEYWORD = PhpVersion::PHP_71; + final public const RESERVED_OBJECT_KEYWORD = PhpVersion::PHP_71; /** * @var int */ - public const DEPRECATE_EACH = PhpVersion::PHP_72; + final public const DEPRECATE_EACH = PhpVersion::PHP_72; /** * @var int */ - public const OBJECT_TYPE = PhpVersion::PHP_72; + final public const OBJECT_TYPE = PhpVersion::PHP_72; /** * @var int */ - public const NO_EACH_OUTSIDE_LOOP = PhpVersion::PHP_72; + final public const NO_EACH_OUTSIDE_LOOP = PhpVersion::PHP_72; /** * @var int */ - public const DEPRECATE_CREATE_FUNCTION = PhpVersion::PHP_72; + final public const DEPRECATE_CREATE_FUNCTION = PhpVersion::PHP_72; /** * @var int */ - public const NO_NULL_ON_GET_CLASS = PhpVersion::PHP_72; + final public const NO_NULL_ON_GET_CLASS = PhpVersion::PHP_72; /** * @var int */ - public const INVERTED_BOOL_IS_OBJECT_INCOMPLETE_CLASS = PhpVersion::PHP_72; + final public const INVERTED_BOOL_IS_OBJECT_INCOMPLETE_CLASS = PhpVersion::PHP_72; /** * @var int */ - public const RESULT_ARG_IN_PARSE_STR = PhpVersion::PHP_72; + final public const RESULT_ARG_IN_PARSE_STR = PhpVersion::PHP_72; /** * @var int */ - public const STRING_IN_FIRST_DEFINE_ARG = PhpVersion::PHP_72; + final public const STRING_IN_FIRST_DEFINE_ARG = PhpVersion::PHP_72; /** * @var int */ - public const STRING_IN_ASSERT_ARG = PhpVersion::PHP_72; + final public const STRING_IN_ASSERT_ARG = PhpVersion::PHP_72; /** * @var int */ - public const NO_UNSET_CAST = PhpVersion::PHP_72; + final public const NO_UNSET_CAST = PhpVersion::PHP_72; /** * @var int */ - public const IS_COUNTABLE = PhpVersion::PHP_73; + final public const IS_COUNTABLE = PhpVersion::PHP_73; /** * @var int */ - public const ARRAY_KEY_FIRST_LAST = PhpVersion::PHP_73; + final public const ARRAY_KEY_FIRST_LAST = PhpVersion::PHP_73; /** * @var int */ - public const JSON_EXCEPTION = PhpVersion::PHP_73; + final public const JSON_EXCEPTION = PhpVersion::PHP_73; /** * @var int */ - public const SETCOOKIE_ACCEPT_ARRAY_OPTIONS = PhpVersion::PHP_73; + final public const SETCOOKIE_ACCEPT_ARRAY_OPTIONS = PhpVersion::PHP_73; /** * @var int */ - public const DEPRECATE_INSENSITIVE_CONSTANT_NAME = PhpVersion::PHP_73; + final public const DEPRECATE_INSENSITIVE_CONSTANT_NAME = PhpVersion::PHP_73; /** * @var int */ - public const ESCAPE_DASH_IN_REGEX = PhpVersion::PHP_73; + final public const ESCAPE_DASH_IN_REGEX = PhpVersion::PHP_73; /** * @var int */ - public const DEPRECATE_INSENSITIVE_CONSTANT_DEFINE = PhpVersion::PHP_73; + final public const DEPRECATE_INSENSITIVE_CONSTANT_DEFINE = PhpVersion::PHP_73; /** * @var int */ - public const DEPRECATE_INT_IN_STR_NEEDLES = PhpVersion::PHP_73; + final public const DEPRECATE_INT_IN_STR_NEEDLES = PhpVersion::PHP_73; /** * @var int */ - public const SENSITIVE_HERE_NOW_DOC = PhpVersion::PHP_73; + final public const SENSITIVE_HERE_NOW_DOC = PhpVersion::PHP_73; /** * @var int */ - public const ARROW_FUNCTION = PhpVersion::PHP_74; + final public const ARROW_FUNCTION = PhpVersion::PHP_74; /** * @var int */ - public const LITERAL_SEPARATOR = PhpVersion::PHP_74; + final public const LITERAL_SEPARATOR = PhpVersion::PHP_74; /** * @var int */ - public const NULL_COALESCE_ASSIGN = PhpVersion::PHP_74; + final public const NULL_COALESCE_ASSIGN = PhpVersion::PHP_74; /** * @var int */ - public const TYPED_PROPERTIES = PhpVersion::PHP_74; + final public const TYPED_PROPERTIES = PhpVersion::PHP_74; /** * @see https://wiki.php.net/rfc/covariant-returns-and-contravariant-parameters * @var int */ - public const COVARIANT_RETURN = PhpVersion::PHP_74; + final public const COVARIANT_RETURN = PhpVersion::PHP_74; /** * @var int */ - public const ARRAY_SPREAD = PhpVersion::PHP_74; + final public const ARRAY_SPREAD = PhpVersion::PHP_74; /** * @var int */ - public const DEPRECATE_CURLY_BRACKET_ARRAY_STRING = PhpVersion::PHP_74; + final public const DEPRECATE_CURLY_BRACKET_ARRAY_STRING = PhpVersion::PHP_74; /** * @var int */ - public const DEPRECATE_REAL = PhpVersion::PHP_74; + final public const DEPRECATE_REAL = PhpVersion::PHP_74; /** * @var int */ - public const ARRAY_KEY_EXISTS_TO_PROPERTY_EXISTS = PhpVersion::PHP_74; + final public const ARRAY_KEY_EXISTS_TO_PROPERTY_EXISTS = PhpVersion::PHP_74; /** * @var int */ - public const FILTER_VAR_TO_ADD_SLASHES = PhpVersion::PHP_74; + final public const FILTER_VAR_TO_ADD_SLASHES = PhpVersion::PHP_74; /** * @var int */ - public const CHANGE_MB_STRPOS_ARG_POSITION = PhpVersion::PHP_74; + final public const CHANGE_MB_STRPOS_ARG_POSITION = PhpVersion::PHP_74; /** * @var int */ - public const RESERVED_FN_FUNCTION_NAME = PhpVersion::PHP_74; + final public const RESERVED_FN_FUNCTION_NAME = PhpVersion::PHP_74; /** * @var int */ - public const REFLECTION_TYPE_GETNAME = PhpVersion::PHP_74; + final public const REFLECTION_TYPE_GETNAME = PhpVersion::PHP_74; /** * @var int */ - public const EXPORT_TO_REFLECTION_FUNCTION = PhpVersion::PHP_74; + final public const EXPORT_TO_REFLECTION_FUNCTION = PhpVersion::PHP_74; /** * @var int */ - public const UNION_TYPES = PhpVersion::PHP_80; + final public const UNION_TYPES = PhpVersion::PHP_80; /** * @var int */ - public const CLASS_ON_OBJECT = PhpVersion::PHP_80; + final public const CLASS_ON_OBJECT = PhpVersion::PHP_80; /** * @var int */ - public const STATIC_RETURN_TYPE = PhpVersion::PHP_80; + final public const STATIC_RETURN_TYPE = PhpVersion::PHP_80; /** * @var int */ - public const NO_FINAL_PRIVATE = PhpVersion::PHP_80; + final public const NO_FINAL_PRIVATE = PhpVersion::PHP_80; /** * @var int */ - public const DEPRECATE_REQUIRED_PARAMETER_AFTER_OPTIONAL = PhpVersion::PHP_80; + final public const DEPRECATE_REQUIRED_PARAMETER_AFTER_OPTIONAL = PhpVersion::PHP_80; /** * @var int */ - public const STATIC_VISIBILITY_SET_STATE = PhpVersion::PHP_80; + final public const STATIC_VISIBILITY_SET_STATE = PhpVersion::PHP_80; /** * @var int */ - public const IS_ITERABLE = PhpVersion::PHP_71; + final public const IS_ITERABLE = PhpVersion::PHP_71; /** * @var int */ - public const NULLABLE_TYPE = PhpVersion::PHP_71; + final public const NULLABLE_TYPE = PhpVersion::PHP_71; /** * @var int */ - public const PARENT_VISIBILITY_OVERRIDE = PhpVersion::PHP_72; + final public const PARENT_VISIBILITY_OVERRIDE = PhpVersion::PHP_72; /** * @var int */ - public const COUNT_ON_NULL = PhpVersion::PHP_71; + final public const COUNT_ON_NULL = PhpVersion::PHP_71; /** * @see https://wiki.php.net/rfc/constructor_promotion * @var int */ - public const PROPERTY_PROMOTION = PhpVersion::PHP_80; + final public const PROPERTY_PROMOTION = PhpVersion::PHP_80; /** * @see https://wiki.php.net/rfc/attributes_v2 * @var int */ - public const ATTRIBUTES = PhpVersion::PHP_80; + final public const ATTRIBUTES = PhpVersion::PHP_80; /** * @var int */ - public const STRINGABLE = PhpVersion::PHP_80; + final public const STRINGABLE = PhpVersion::PHP_80; /** * @var int */ - public const PHP_TOKEN = PhpVersion::PHP_80; + final public const PHP_TOKEN = PhpVersion::PHP_80; /** * @var int */ - public const STR_ENDS_WITH = PhpVersion::PHP_80; + final public const STR_ENDS_WITH = PhpVersion::PHP_80; /** * @var int */ - public const STR_STARTS_WITH = PhpVersion::PHP_80; + final public const STR_STARTS_WITH = PhpVersion::PHP_80; /** * @var int */ - public const STR_CONTAINS = PhpVersion::PHP_80; + final public const STR_CONTAINS = PhpVersion::PHP_80; /** * @var int */ - public const GET_DEBUG_TYPE = PhpVersion::PHP_80; + final public const GET_DEBUG_TYPE = PhpVersion::PHP_80; /** * @see https://wiki.php.net/rfc/noreturn_type * @var int */ - public const NEVER_TYPE = PhpVersion::PHP_81; + final public const NEVER_TYPE = PhpVersion::PHP_81; /** * @see https://wiki.php.net/rfc/variadics * @var int */ - public const VARIADIC_PARAM = PhpVersion::PHP_56; + final public const VARIADIC_PARAM = PhpVersion::PHP_56; /** * @see https://wiki.php.net/rfc/readonly_and_immutable_properties * @var int */ - public const READONLY_PROPERTY = PhpVersion::PHP_81; + final public const READONLY_PROPERTY = PhpVersion::PHP_81; /** * @see https://wiki.php.net/rfc/final_class_const * @var int */ - public const FINAL_CLASS_CONSTANTS = PhpVersion::PHP_81; + final public const FINAL_CLASS_CONSTANTS = PhpVersion::PHP_81; /** * @see https://wiki.php.net/rfc/enumerations * @var int */ - public const ENUM = PhpVersion::PHP_81; + final public const ENUM = PhpVersion::PHP_81; /** * @see https://wiki.php.net/rfc/match_expression_v2 * @var int */ - public const MATCH_EXPRESSION = PhpVersion::PHP_80; + final public const MATCH_EXPRESSION = PhpVersion::PHP_80; /** * @see https://wiki.php.net/rfc/non-capturing_catches * @var int */ - public const NON_CAPTURING_CATCH = PhpVersion::PHP_80; + final public const NON_CAPTURING_CATCH = PhpVersion::PHP_80; /** * @see https://www.php.net/manual/en/migration80.incompatible.php#migration80.incompatible.resource2object * @var int */ - public const PHP8_RESOURCE_TO_OBJECT = PhpVersion::PHP_80; + final public const PHP8_RESOURCE_TO_OBJECT = PhpVersion::PHP_80; /** * @see https://www.php.net/manual/en/migration81.incompatible.php#migration81.incompatible.resource2object * @var int */ - public const PHP81_RESOURCE_TO_OBJECT = PhpVersion::PHP_81; + final public const PHP81_RESOURCE_TO_OBJECT = PhpVersion::PHP_81; /** * @see https://wiki.php.net/rfc/new_in_initializers * @var int */ - public const NEW_INITIALIZERS = PhpVersion::PHP_81; + final public const NEW_INITIALIZERS = PhpVersion::PHP_81; /** * @see https://wiki.php.net/rfc/pure-intersection-types * @var int */ - public const INTERSECTION_TYPES = PhpVersion::PHP_81; + final public const INTERSECTION_TYPES = PhpVersion::PHP_81; /** * @see https://wiki.php.net/rfc/array_unpacking_string_keys * @var int */ - public const ARRAY_SPREAD_STRING_KEYS = PhpVersion::PHP_81; + final public const ARRAY_SPREAD_STRING_KEYS = PhpVersion::PHP_81; /** * @see https://wiki.php.net/rfc/deprecate_dynamic_properties * @var int */ - public const DEPRECATE_DYNAMIC_PROPERTIES = PhpVersion::PHP_82; + final public const DEPRECATE_DYNAMIC_PROPERTIES = PhpVersion::PHP_82; } diff --git a/src/ValueObject/StaticNonPhpFileSuffixes.php b/src/ValueObject/StaticNonPhpFileSuffixes.php index 743fa5e2c0b..d3fe25157bf 100644 --- a/src/ValueObject/StaticNonPhpFileSuffixes.php +++ b/src/ValueObject/StaticNonPhpFileSuffixes.php @@ -9,7 +9,7 @@ final class StaticNonPhpFileSuffixes /** * @var string[] */ - public const SUFFIXES = ['neon', 'yaml', 'xml', 'yml', 'twig', 'latte', 'blade.php']; + final public const SUFFIXES = ['neon', 'yaml', 'xml', 'yml', 'twig', 'latte', 'blade.php']; public static function getSuffixRegexPattern(): string { diff --git a/src/ValueObject/Visibility.php b/src/ValueObject/Visibility.php index 70792791994..868e7af138f 100644 --- a/src/ValueObject/Visibility.php +++ b/src/ValueObject/Visibility.php @@ -11,35 +11,35 @@ final class Visibility /** * @var int */ - public const PUBLIC = Class_::MODIFIER_PUBLIC; + final public const PUBLIC = Class_::MODIFIER_PUBLIC; /** * @var int */ - public const PROTECTED = Class_::MODIFIER_PROTECTED; + final public const PROTECTED = Class_::MODIFIER_PROTECTED; /** * @var int */ - public const PRIVATE = Class_::MODIFIER_PRIVATE; + final public const PRIVATE = Class_::MODIFIER_PRIVATE; /** * @var int */ - public const STATIC = Class_::MODIFIER_STATIC; + final public const STATIC = Class_::MODIFIER_STATIC; /** * @var int */ - public const ABSTRACT = Class_::MODIFIER_ABSTRACT; + final public const ABSTRACT = Class_::MODIFIER_ABSTRACT; /** * @var int */ - public const FINAL = Class_::MODIFIER_FINAL; + final public const FINAL = Class_::MODIFIER_FINAL; /** * @var int */ - public const READONLY = Class_::MODIFIER_READONLY; + final public const READONLY = Class_::MODIFIER_READONLY; } From b8242f903d9713510ec7cb069696a902c7eedb7c Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 2 Dec 2021 18:08:59 +0700 Subject: [PATCH 04/13] udpate danielstjules/stringy to use fork --- composer.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a3af63f28ec..6e384896093 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "clue/ndjson-react": "^1.2", "composer/semver": "^3.2", "composer/xdebug-handler": "^2.0", - "danielstjules/stringy": "^3.1", + "danielstjules/stringy": "dev-php81-return-type-willchange as 3.1.0", "doctrine/inflector": "^2.0", "ergebnis/json-printer": "^3.1", "idiosyncratic/editorconfig": "^0.1.3", @@ -167,6 +167,12 @@ "sort-packages": true, "platform-check": false }, + "repositories" : [ + { + "type" : "vcs", + "url" : "https://github.com/samsonasik/Stringy" + } + ], "minimum-stability": "dev", "prefer-stable": true } From 751761f25d826479a0c6d98ffcf49b1263219cfd Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 2 Dec 2021 18:10:39 +0700 Subject: [PATCH 05/13] use no-api true to fix error Could not authenticate against github.com --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6e384896093..612bf2ee7b6 100644 --- a/composer.json +++ b/composer.json @@ -170,7 +170,8 @@ "repositories" : [ { "type" : "vcs", - "url" : "https://github.com/samsonasik/Stringy" + "url" : "https://github.com/samsonasik/Stringy", + "no-api": true } ], "minimum-stability": "dev", From 61085659ee4477f7a8585ca0063d1df193bbd90e Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 2 Dec 2021 11:29:38 +0000 Subject: [PATCH 06/13] [ci-review] Rector Rectify --- rules/Arguments/NodeAnalyzer/ArgumentAddingScope.php | 6 +++--- .../Arguments/Rector/ClassMethod/ArgumentAdderRector.php | 2 +- .../ClassMethod/ReplaceArgumentDefaultValueRector.php | 2 +- .../FunctionArgumentDefaultValueReplacerRector.php | 2 +- .../Rector/FuncCall/SwapFuncCallArgumentsRector.php | 2 +- .../Arguments/ValueObject/ReplaceArgumentDefaultValue.php | 2 +- .../Class_/MoveServicesBySuffixToDirectoryRector.php | 2 +- .../MoveValueObjectsToValueObjectDirectoryRector.php | 6 +++--- .../Rector/ClassMethod/OrderAttributesRector.php | 2 +- .../ClassMethod/ReturnArrayClassMethodToYieldRector.php | 2 +- .../Rector/FuncCall/ConsistentPregDelimiterRector.php | 2 +- .../MethodCall/PreferThisOrSelfMethodCallRector.php | 2 +- rules/CodingStyle/ValueObject/ObjectMagicMethods.php | 2 +- .../Composer/Rector/AddPackageToRequireComposerRector.php | 2 +- .../Rector/AddPackageToRequireDevComposerRector.php | 2 +- .../Rector/ChangePackageVersionComposerRector.php | 2 +- rules/Composer/Rector/RemovePackageComposerRector.php | 2 +- rules/Composer/Rector/RenamePackageComposerRector.php | 2 +- .../Rector/ReplacePackageAndVersionComposerRector.php | 2 +- .../DeadCode/Rector/ClassLike/RemoveAnnotationRector.php | 2 +- .../Rector/ConstFetch/RemovePhpVersionIdCheckRector.php | 2 +- rules/DeadCode/ValueObject/VariableNodeUse.php | 4 ++-- .../Rector/ClassMethod/AddMethodParentCallRector.php | 2 +- .../ClassMethod/DowngradeParameterTypeWideningRector.php | 4 ++-- .../Class_/DowngradeAttributeToAnnotationRector.php | 2 +- .../Rector/ClassMethod/GenericClassMethodParamRector.php | 2 +- .../String_/StringClassNameToClassConstantRector.php | 2 +- rules/Php71/Rector/Name/ReservedObjectRector.php | 2 +- rules/Php74/Rector/Function_/ReservedFnFunctionRector.php | 8 ++------ .../Rector/LNumber/AddLiteralSeparatorToNumberRector.php | 2 +- rules/Php74/Rector/Property/TypedPropertyRector.php | 4 ++-- rules/Php80/Rector/Class_/AnnotationToAttributeRector.php | 2 +- .../Class_/DoctrineAnnotationClassToAttributeRector.php | 2 +- .../MethodCall/ReplaceStringWithClassConstantRector.php | 2 +- .../Removing/Rector/ClassMethod/ArgumentRemoverRector.php | 2 +- rules/Removing/Rector/Class_/RemoveInterfacesRector.php | 2 +- rules/Removing/Rector/Class_/RemoveParentRector.php | 2 +- rules/Removing/Rector/Class_/RemoveTraitUseRector.php | 2 +- .../Removing/Rector/FuncCall/RemoveFuncCallArgRector.php | 2 +- rules/Removing/Rector/FuncCall/RemoveFuncCallRector.php | 2 +- .../ClassConstFetch/RenameClassConstFetchRector.php | 2 +- .../Rector/ClassMethod/RenameAnnotationRector.php | 2 +- rules/Renaming/Rector/ConstFetch/RenameConstantRector.php | 2 +- .../PseudoNamespaceToNamespaceRector.php | 2 +- rules/Renaming/Rector/FuncCall/RenameFunctionRector.php | 2 +- rules/Renaming/Rector/MethodCall/RenameMethodRector.php | 2 +- rules/Renaming/Rector/Name/RenameClassRector.php | 2 +- .../Renaming/Rector/Namespace_/RenameNamespaceRector.php | 2 +- .../Rector/PropertyFetch/RenamePropertyRector.php | 2 +- .../Rector/StaticCall/RenameStaticMethodRector.php | 2 +- rules/Renaming/Rector/String_/RenameStringRector.php | 2 +- .../CompleteImportForPartialAnnotationRector.php | 2 +- .../Strict/Rector/AbstractFalsyScalarRuleFixerRector.php | 2 +- .../Rector/Assign/DimFetchAssignToMethodCallRector.php | 2 +- .../Rector/Assign/GetAndSetToMethodCallRector.php | 2 +- .../Rector/Assign/PropertyAssignToMethodCallRector.php | 2 +- .../Rector/Assign/PropertyFetchToMethodCallRector.php | 2 +- .../Attribute/AttributeKeyToClassConstFetchRector.php | 2 +- .../Rector/ClassMethod/SingleToManyMethodRector.php | 2 +- rules/Transform/Rector/ClassMethod/WrapReturnRector.php | 2 +- .../Rector/Class_/AddInterfaceByParentRector.php | 2 +- .../Transform/Rector/Class_/AddInterfaceByTraitRector.php | 2 +- rules/Transform/Rector/Class_/MergeInterfacesRector.php | 2 +- .../Transform/Rector/Class_/ParentClassToTraitsRector.php | 2 +- .../FuncCall/ArgumentFuncCallToMethodCallRector.php | 2 +- .../Rector/FuncCall/FuncCallToConstFetchRector.php | 2 +- .../Rector/FuncCall/FuncCallToMethodCallRector.php | 2 +- rules/Transform/Rector/FuncCall/FuncCallToNewRector.php | 2 +- .../Rector/FuncCall/FuncCallToStaticCallRector.php | 2 +- .../Rector/Isset_/UnsetAndIssetToMethodCallRector.php | 2 +- .../MethodCall/CallableInMethodCallToVariableRector.php | 2 +- .../MethodCallToAnotherMethodCallWithArgumentsRector.php | 2 +- .../Rector/MethodCall/MethodCallToMethodCallRector.php | 2 +- .../Rector/MethodCall/MethodCallToPropertyFetchRector.php | 2 +- .../Rector/MethodCall/MethodCallToStaticCallRector.php | 2 +- .../MethodCall/ReplaceParentCallByPropertyCallRector.php | 2 +- .../ServiceGetterToConstructorInjectionRector.php | 2 +- rules/Transform/Rector/New_/NewArgToMethodCallRector.php | 2 +- .../Rector/New_/NewToConstructorInjectionRector.php | 2 +- rules/Transform/Rector/New_/NewToMethodCallRector.php | 2 +- rules/Transform/Rector/New_/NewToStaticCallRector.php | 2 +- .../Rector/StaticCall/StaticCallToFuncCallRector.php | 2 +- .../Rector/StaticCall/StaticCallToMethodCallRector.php | 2 +- .../Transform/Rector/StaticCall/StaticCallToNewRector.php | 2 +- .../Rector/String_/StringToClassConstantRector.php | 2 +- .../Rector/String_/ToStringToMethodCallRector.php | 2 +- .../Rector/ClassMethod/AddParamTypeDeclarationRector.php | 2 +- .../Rector/ClassMethod/AddReturnTypeDeclarationRector.php | 2 +- .../ClassMethod/AddVoidReturnTypeWhereNoReturnRector.php | 2 +- .../Rector/ClassConst/ChangeConstantVisibilityRector.php | 2 +- .../Rector/ClassMethod/ChangeMethodVisibilityRector.php | 2 +- 91 files changed, 99 insertions(+), 103 deletions(-) diff --git a/rules/Arguments/NodeAnalyzer/ArgumentAddingScope.php b/rules/Arguments/NodeAnalyzer/ArgumentAddingScope.php index 6f3200e3987..af9374e179f 100644 --- a/rules/Arguments/NodeAnalyzer/ArgumentAddingScope.php +++ b/rules/Arguments/NodeAnalyzer/ArgumentAddingScope.php @@ -16,17 +16,17 @@ final class ArgumentAddingScope /** * @var string */ - public const SCOPE_PARENT_CALL = 'parent_call'; + final public const SCOPE_PARENT_CALL = 'parent_call'; /** * @var string */ - public const SCOPE_METHOD_CALL = 'method_call'; + final public const SCOPE_METHOD_CALL = 'method_call'; /** * @var string */ - public const SCOPE_CLASS_METHOD = 'class_method'; + final public const SCOPE_CLASS_METHOD = 'class_method'; public function __construct( private readonly NodeNameResolver $nodeNameResolver diff --git a/rules/Arguments/Rector/ClassMethod/ArgumentAdderRector.php b/rules/Arguments/Rector/ClassMethod/ArgumentAdderRector.php index 47040d55ffb..b83b08e44dc 100644 --- a/rules/Arguments/Rector/ClassMethod/ArgumentAdderRector.php +++ b/rules/Arguments/Rector/ClassMethod/ArgumentAdderRector.php @@ -36,7 +36,7 @@ final class ArgumentAdderRector extends AbstractRector implements ConfigurableRe /** * @var string */ - public const ADDED_ARGUMENTS = 'added_arguments'; + final public const ADDED_ARGUMENTS = 'added_arguments'; /** * @var ArgumentAdder[] diff --git a/rules/Arguments/Rector/ClassMethod/ReplaceArgumentDefaultValueRector.php b/rules/Arguments/Rector/ClassMethod/ReplaceArgumentDefaultValueRector.php index 84cc0ca62f5..745a624b085 100644 --- a/rules/Arguments/Rector/ClassMethod/ReplaceArgumentDefaultValueRector.php +++ b/rules/Arguments/Rector/ClassMethod/ReplaceArgumentDefaultValueRector.php @@ -24,7 +24,7 @@ final class ReplaceArgumentDefaultValueRector extends AbstractRector implements /** * @var string */ - public const REPLACED_ARGUMENTS = 'replaced_arguments'; + final public const REPLACED_ARGUMENTS = 'replaced_arguments'; /** * @var ReplaceArgumentDefaultValue[] diff --git a/rules/Arguments/Rector/FuncCall/FunctionArgumentDefaultValueReplacerRector.php b/rules/Arguments/Rector/FuncCall/FunctionArgumentDefaultValueReplacerRector.php index b259a61594f..e9f32b59122 100644 --- a/rules/Arguments/Rector/FuncCall/FunctionArgumentDefaultValueReplacerRector.php +++ b/rules/Arguments/Rector/FuncCall/FunctionArgumentDefaultValueReplacerRector.php @@ -25,7 +25,7 @@ final class FunctionArgumentDefaultValueReplacerRector extends AbstractRector im /** * @var string */ - public const REPLACED_ARGUMENTS = 'replaced_arguments'; + final public const REPLACED_ARGUMENTS = 'replaced_arguments'; /** * @var ReplaceFuncCallArgumentDefaultValue[] diff --git a/rules/Arguments/Rector/FuncCall/SwapFuncCallArgumentsRector.php b/rules/Arguments/Rector/FuncCall/SwapFuncCallArgumentsRector.php index 926195e87d0..26ff04a9ca4 100644 --- a/rules/Arguments/Rector/FuncCall/SwapFuncCallArgumentsRector.php +++ b/rules/Arguments/Rector/FuncCall/SwapFuncCallArgumentsRector.php @@ -22,7 +22,7 @@ final class SwapFuncCallArgumentsRector extends AbstractRector implements Config /** * @var string */ - public const FUNCTION_ARGUMENT_SWAPS = 'new_argument_positions_by_function_name'; + final public const FUNCTION_ARGUMENT_SWAPS = 'new_argument_positions_by_function_name'; /** * @var string diff --git a/rules/Arguments/ValueObject/ReplaceArgumentDefaultValue.php b/rules/Arguments/ValueObject/ReplaceArgumentDefaultValue.php index cb072581a61..4ad4b838b90 100644 --- a/rules/Arguments/ValueObject/ReplaceArgumentDefaultValue.php +++ b/rules/Arguments/ValueObject/ReplaceArgumentDefaultValue.php @@ -12,7 +12,7 @@ final class ReplaceArgumentDefaultValue implements ReplaceArgumentDefaultValueIn /** * @var string */ - public const ANY_VALUE_BEFORE = '*ANY_VALUE_BEFORE*'; + final public const ANY_VALUE_BEFORE = '*ANY_VALUE_BEFORE*'; /** * @param mixed $valueBefore diff --git a/rules/Autodiscovery/Rector/Class_/MoveServicesBySuffixToDirectoryRector.php b/rules/Autodiscovery/Rector/Class_/MoveServicesBySuffixToDirectoryRector.php index ca15a64c236..8bd1650dd7e 100644 --- a/rules/Autodiscovery/Rector/Class_/MoveServicesBySuffixToDirectoryRector.php +++ b/rules/Autodiscovery/Rector/Class_/MoveServicesBySuffixToDirectoryRector.php @@ -28,7 +28,7 @@ final class MoveServicesBySuffixToDirectoryRector extends AbstractRector impleme /** * @var string */ - public const GROUP_NAMES_BY_SUFFIX = 'group_names_by_suffix'; + final public const GROUP_NAMES_BY_SUFFIX = 'group_names_by_suffix'; /** * @var string[] diff --git a/rules/Autodiscovery/Rector/Class_/MoveValueObjectsToValueObjectDirectoryRector.php b/rules/Autodiscovery/Rector/Class_/MoveValueObjectsToValueObjectDirectoryRector.php index 1147bb57f18..b522ddd142b 100644 --- a/rules/Autodiscovery/Rector/Class_/MoveValueObjectsToValueObjectDirectoryRector.php +++ b/rules/Autodiscovery/Rector/Class_/MoveValueObjectsToValueObjectDirectoryRector.php @@ -28,18 +28,18 @@ final class MoveValueObjectsToValueObjectDirectoryRector extends AbstractRector /** * @var string */ - public const TYPES = 'types'; + final public const TYPES = 'types'; /** * @var string */ - public const SUFFIXES = 'suffixes'; + final public const SUFFIXES = 'suffixes'; /** * @api * @var string */ - public const ENABLE_VALUE_OBJECT_GUESSING = 'enable_value_object_guessing'; + final public const ENABLE_VALUE_OBJECT_GUESSING = 'enable_value_object_guessing'; /** * @var string[]|class-string[] diff --git a/rules/CodingStyle/Rector/ClassMethod/OrderAttributesRector.php b/rules/CodingStyle/Rector/ClassMethod/OrderAttributesRector.php index d208ead38b1..4fa58f548c0 100644 --- a/rules/CodingStyle/Rector/ClassMethod/OrderAttributesRector.php +++ b/rules/CodingStyle/Rector/ClassMethod/OrderAttributesRector.php @@ -27,7 +27,7 @@ final class OrderAttributesRector extends AbstractRector implements Configurable /** * @var string */ - public const ATTRIBUTES_ORDER = 'attributes_order'; + final public const ATTRIBUTES_ORDER = 'attributes_order'; /** * @var array diff --git a/rules/CodingStyle/Rector/ClassMethod/ReturnArrayClassMethodToYieldRector.php b/rules/CodingStyle/Rector/ClassMethod/ReturnArrayClassMethodToYieldRector.php index 80546a6bfed..d5e90411c14 100644 --- a/rules/CodingStyle/Rector/ClassMethod/ReturnArrayClassMethodToYieldRector.php +++ b/rules/CodingStyle/Rector/ClassMethod/ReturnArrayClassMethodToYieldRector.php @@ -32,7 +32,7 @@ final class ReturnArrayClassMethodToYieldRector extends AbstractRector implement /** * @var string */ - public const METHODS_TO_YIELDS = 'methods_to_yields'; + final public const METHODS_TO_YIELDS = 'methods_to_yields'; /** * @var ReturnArrayClassMethodToyield[] diff --git a/rules/CodingStyle/Rector/FuncCall/ConsistentPregDelimiterRector.php b/rules/CodingStyle/Rector/FuncCall/ConsistentPregDelimiterRector.php index 7d0fd44425e..7ee5cb46fe4 100644 --- a/rules/CodingStyle/Rector/FuncCall/ConsistentPregDelimiterRector.php +++ b/rules/CodingStyle/Rector/FuncCall/ConsistentPregDelimiterRector.php @@ -27,7 +27,7 @@ final class ConsistentPregDelimiterRector extends AbstractRector implements Conf * @api * @var string */ - public const DELIMITER = 'delimiter'; + final public const DELIMITER = 'delimiter'; /** * @var string diff --git a/rules/CodingStyle/Rector/MethodCall/PreferThisOrSelfMethodCallRector.php b/rules/CodingStyle/Rector/MethodCall/PreferThisOrSelfMethodCallRector.php index 90d207913ee..b80c7453ac3 100644 --- a/rules/CodingStyle/Rector/MethodCall/PreferThisOrSelfMethodCallRector.php +++ b/rules/CodingStyle/Rector/MethodCall/PreferThisOrSelfMethodCallRector.php @@ -27,7 +27,7 @@ final class PreferThisOrSelfMethodCallRector extends AbstractRector implements C * @api * @var string */ - public const TYPE_TO_PREFERENCE = 'type_to_preference'; + final public const TYPE_TO_PREFERENCE = 'type_to_preference'; /** * @var array diff --git a/rules/CodingStyle/ValueObject/ObjectMagicMethods.php b/rules/CodingStyle/ValueObject/ObjectMagicMethods.php index 3222fd7c0a8..1d35c854405 100644 --- a/rules/CodingStyle/ValueObject/ObjectMagicMethods.php +++ b/rules/CodingStyle/ValueObject/ObjectMagicMethods.php @@ -11,7 +11,7 @@ final class ObjectMagicMethods /** * @var string[] */ - public const METHOD_NAMES = [ + final public const METHOD_NAMES = [ '__call', '__callStatic', MethodName::CLONE, diff --git a/rules/Composer/Rector/AddPackageToRequireComposerRector.php b/rules/Composer/Rector/AddPackageToRequireComposerRector.php index d219f722b53..3e9716eefda 100644 --- a/rules/Composer/Rector/AddPackageToRequireComposerRector.php +++ b/rules/Composer/Rector/AddPackageToRequireComposerRector.php @@ -20,7 +20,7 @@ final class AddPackageToRequireComposerRector implements ComposerRectorInterface /** * @var string */ - public const PACKAGES_AND_VERSIONS = 'packages_and_versions'; + final public const PACKAGES_AND_VERSIONS = 'packages_and_versions'; /** * @var PackageAndVersion[] diff --git a/rules/Composer/Rector/AddPackageToRequireDevComposerRector.php b/rules/Composer/Rector/AddPackageToRequireDevComposerRector.php index be20bebd0b0..af990ba2194 100644 --- a/rules/Composer/Rector/AddPackageToRequireDevComposerRector.php +++ b/rules/Composer/Rector/AddPackageToRequireDevComposerRector.php @@ -20,7 +20,7 @@ final class AddPackageToRequireDevComposerRector implements ComposerRectorInterf /** * @var string */ - public const PACKAGES_AND_VERSIONS = 'packages_and_version'; + final public const PACKAGES_AND_VERSIONS = 'packages_and_version'; /** * @var PackageAndVersion[] diff --git a/rules/Composer/Rector/ChangePackageVersionComposerRector.php b/rules/Composer/Rector/ChangePackageVersionComposerRector.php index 5957b7494da..f0fd8053e93 100644 --- a/rules/Composer/Rector/ChangePackageVersionComposerRector.php +++ b/rules/Composer/Rector/ChangePackageVersionComposerRector.php @@ -20,7 +20,7 @@ final class ChangePackageVersionComposerRector implements ComposerRectorInterfac /** * @var string */ - public const PACKAGES_AND_VERSIONS = 'packages_and_versions'; + final public const PACKAGES_AND_VERSIONS = 'packages_and_versions'; /** * @var PackageAndVersion[] diff --git a/rules/Composer/Rector/RemovePackageComposerRector.php b/rules/Composer/Rector/RemovePackageComposerRector.php index de977f2ca6e..3c755d41e13 100644 --- a/rules/Composer/Rector/RemovePackageComposerRector.php +++ b/rules/Composer/Rector/RemovePackageComposerRector.php @@ -18,7 +18,7 @@ final class RemovePackageComposerRector implements ComposerRectorInterface /** * @var string */ - public const PACKAGE_NAMES = 'package_names'; + final public const PACKAGE_NAMES = 'package_names'; /** * @var string[] diff --git a/rules/Composer/Rector/RenamePackageComposerRector.php b/rules/Composer/Rector/RenamePackageComposerRector.php index e54f6734c11..21a1bed3a20 100644 --- a/rules/Composer/Rector/RenamePackageComposerRector.php +++ b/rules/Composer/Rector/RenamePackageComposerRector.php @@ -19,7 +19,7 @@ final class RenamePackageComposerRector implements ComposerRectorInterface /** * @var string */ - public const RENAME_PACKAGES = 'rename_packages'; + final public const RENAME_PACKAGES = 'rename_packages'; /** * @var RenamePackage[] diff --git a/rules/Composer/Rector/ReplacePackageAndVersionComposerRector.php b/rules/Composer/Rector/ReplacePackageAndVersionComposerRector.php index 5383d7fc390..a7eed3ee811 100644 --- a/rules/Composer/Rector/ReplacePackageAndVersionComposerRector.php +++ b/rules/Composer/Rector/ReplacePackageAndVersionComposerRector.php @@ -20,7 +20,7 @@ final class ReplacePackageAndVersionComposerRector implements ComposerRectorInte /** * @var string */ - public const REPLACE_PACKAGES_AND_VERSIONS = 'replace_packages_and_versions'; + final public const REPLACE_PACKAGES_AND_VERSIONS = 'replace_packages_and_versions'; /** * @var ReplacePackageAndVersion[] diff --git a/rules/DeadCode/Rector/ClassLike/RemoveAnnotationRector.php b/rules/DeadCode/Rector/ClassLike/RemoveAnnotationRector.php index 1a7ddcbcd87..41137c9bdc3 100644 --- a/rules/DeadCode/Rector/ClassLike/RemoveAnnotationRector.php +++ b/rules/DeadCode/Rector/ClassLike/RemoveAnnotationRector.php @@ -26,7 +26,7 @@ final class RemoveAnnotationRector extends AbstractRector implements Configurabl /** * @var string */ - public const ANNOTATIONS_TO_REMOVE = 'annotations_to_remove'; + final public const ANNOTATIONS_TO_REMOVE = 'annotations_to_remove'; /** * @var string[] diff --git a/rules/DeadCode/Rector/ConstFetch/RemovePhpVersionIdCheckRector.php b/rules/DeadCode/Rector/ConstFetch/RemovePhpVersionIdCheckRector.php index 0424da0d0af..7e067fbb498 100644 --- a/rules/DeadCode/Rector/ConstFetch/RemovePhpVersionIdCheckRector.php +++ b/rules/DeadCode/Rector/ConstFetch/RemovePhpVersionIdCheckRector.php @@ -28,7 +28,7 @@ final class RemovePhpVersionIdCheckRector extends AbstractRector implements Conf /** * @var string */ - public const PHP_VERSION_CONSTRAINT = 'phpVersionConstraint'; + final public const PHP_VERSION_CONSTRAINT = 'phpVersionConstraint'; private string | int | null $phpVersionConstraint; diff --git a/rules/DeadCode/ValueObject/VariableNodeUse.php b/rules/DeadCode/ValueObject/VariableNodeUse.php index 10ce9797eee..94a1b6bd58a 100644 --- a/rules/DeadCode/ValueObject/VariableNodeUse.php +++ b/rules/DeadCode/ValueObject/VariableNodeUse.php @@ -15,12 +15,12 @@ final class VariableNodeUse /** * @var string */ - public const TYPE_USE = 'use'; + final public const TYPE_USE = 'use'; /** * @var string */ - public const TYPE_ASSIGN = 'assign'; + final public const TYPE_ASSIGN = 'assign'; public function __construct( private readonly int $startTokenPosition, diff --git a/rules/DependencyInjection/Rector/ClassMethod/AddMethodParentCallRector.php b/rules/DependencyInjection/Rector/ClassMethod/AddMethodParentCallRector.php index bb7a27249e2..8a542c66e94 100644 --- a/rules/DependencyInjection/Rector/ClassMethod/AddMethodParentCallRector.php +++ b/rules/DependencyInjection/Rector/ClassMethod/AddMethodParentCallRector.php @@ -26,7 +26,7 @@ final class AddMethodParentCallRector extends AbstractRector implements Configur /** * @var string */ - public const METHODS_BY_PARENT_TYPES = 'methods_by_parent_type'; + final public const METHODS_BY_PARENT_TYPES = 'methods_by_parent_type'; /** * @var array diff --git a/rules/DowngradePhp72/Rector/ClassMethod/DowngradeParameterTypeWideningRector.php b/rules/DowngradePhp72/Rector/ClassMethod/DowngradeParameterTypeWideningRector.php index f27270f597f..96291752a6e 100644 --- a/rules/DowngradePhp72/Rector/ClassMethod/DowngradeParameterTypeWideningRector.php +++ b/rules/DowngradePhp72/Rector/ClassMethod/DowngradeParameterTypeWideningRector.php @@ -32,12 +32,12 @@ final class DowngradeParameterTypeWideningRector extends AbstractRector implemen /** * @var string */ - public const SAFE_TYPES = 'safe_types'; + final public const SAFE_TYPES = 'safe_types'; /** * @var string */ - public const SAFE_TYPES_TO_METHODS = 'safe_types_to_methods'; + final public const SAFE_TYPES_TO_METHODS = 'safe_types_to_methods'; /** * @var string[] diff --git a/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php b/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php index d989598cab3..8a9ad49d572 100644 --- a/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php +++ b/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php @@ -32,7 +32,7 @@ final class DowngradeAttributeToAnnotationRector extends AbstractRector implemen /** * @var string */ - public const ATTRIBUTE_TO_ANNOTATION = 'attribute_to_annotation'; + final public const ATTRIBUTE_TO_ANNOTATION = 'attribute_to_annotation'; /** * @var DowngradeAttributeToAnnotation[] diff --git a/rules/Generics/Rector/ClassMethod/GenericClassMethodParamRector.php b/rules/Generics/Rector/ClassMethod/GenericClassMethodParamRector.php index ef599ffa130..1b6d513f0aa 100644 --- a/rules/Generics/Rector/ClassMethod/GenericClassMethodParamRector.php +++ b/rules/Generics/Rector/ClassMethod/GenericClassMethodParamRector.php @@ -31,7 +31,7 @@ final class GenericClassMethodParamRector extends AbstractRector implements Conf /** * @var string */ - public const GENERIC_CLASS_METHOD_PARAMS = 'generic_class_method_params'; + final public const GENERIC_CLASS_METHOD_PARAMS = 'generic_class_method_params'; /** * @var GenericClassMethodParam[] diff --git a/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php b/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php index 59ee846324d..21f7d69afd8 100644 --- a/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php +++ b/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php @@ -32,7 +32,7 @@ final class StringClassNameToClassConstantRector extends AbstractRector implemen * @api * @var string */ - public const CLASSES_TO_SKIP = 'classes_to_skip'; + final public const CLASSES_TO_SKIP = 'classes_to_skip'; /** * @var string[] diff --git a/rules/Php71/Rector/Name/ReservedObjectRector.php b/rules/Php71/Rector/Name/ReservedObjectRector.php index 812ed8fe507..f107afd0f35 100644 --- a/rules/Php71/Rector/Name/ReservedObjectRector.php +++ b/rules/Php71/Rector/Name/ReservedObjectRector.php @@ -27,7 +27,7 @@ final class ReservedObjectRector extends AbstractRector implements ConfigurableR /** * @var string */ - public const RESERVED_KEYWORDS_TO_REPLACEMENTS = 'reserved_keywords_to_replacements'; + final public const RESERVED_KEYWORDS_TO_REPLACEMENTS = 'reserved_keywords_to_replacements'; /** * @var array diff --git a/rules/Php74/Rector/Function_/ReservedFnFunctionRector.php b/rules/Php74/Rector/Function_/ReservedFnFunctionRector.php index bd4a2486712..21f383322a9 100644 --- a/rules/Php74/Rector/Function_/ReservedFnFunctionRector.php +++ b/rules/Php74/Rector/Function_/ReservedFnFunctionRector.php @@ -27,7 +27,7 @@ final class ReservedFnFunctionRector extends AbstractRector implements Configura * @api * @var string */ - public const RESERVED_NAMES_TO_NEW_ONES = '$reservedNamesToNewOnes'; + final public const RESERVED_NAMES_TO_NEW_ONES = '$reservedNamesToNewOnes'; /** * @var string[] @@ -100,11 +100,7 @@ public function refactor(Node $node): ?Node continue; } - if ($node instanceof FuncCall) { - $node->name = new Name($newName); - } else { - $node->name = new Identifier($newName); - } + $node->name = $node instanceof FuncCall ? new Name($newName) : new Identifier($newName); return $node; } diff --git a/rules/Php74/Rector/LNumber/AddLiteralSeparatorToNumberRector.php b/rules/Php74/Rector/LNumber/AddLiteralSeparatorToNumberRector.php index 55ba7ff45d4..a8d70c96eee 100644 --- a/rules/Php74/Rector/LNumber/AddLiteralSeparatorToNumberRector.php +++ b/rules/Php74/Rector/LNumber/AddLiteralSeparatorToNumberRector.php @@ -33,7 +33,7 @@ final class AddLiteralSeparatorToNumberRector extends AbstractRector implements * @api * @var string */ - public const LIMIT_VALUE = 'limit_value'; + final public const LIMIT_VALUE = 'limit_value'; /** * @var int diff --git a/rules/Php74/Rector/Property/TypedPropertyRector.php b/rules/Php74/Rector/Property/TypedPropertyRector.php index 8c5503339ed..080fd00fb5b 100644 --- a/rules/Php74/Rector/Property/TypedPropertyRector.php +++ b/rules/Php74/Rector/Property/TypedPropertyRector.php @@ -52,12 +52,12 @@ final class TypedPropertyRector extends AbstractRector implements ConfigurableRe /** * @var string */ - public const CLASS_LIKE_TYPE_ONLY = 'class_like_type_only'; + final public const CLASS_LIKE_TYPE_ONLY = 'class_like_type_only'; /** * @var string */ - public const PRIVATE_PROPERTY_ONLY = 'PRIVATE_PROPERTY_ONLY'; + final public const PRIVATE_PROPERTY_ONLY = 'PRIVATE_PROPERTY_ONLY'; /** * Useful for refactoring of huge applications. Taking types first narrows scope diff --git a/rules/Php80/Rector/Class_/AnnotationToAttributeRector.php b/rules/Php80/Rector/Class_/AnnotationToAttributeRector.php index 4b10867e2e9..a0617821a51 100644 --- a/rules/Php80/Rector/Class_/AnnotationToAttributeRector.php +++ b/rules/Php80/Rector/Class_/AnnotationToAttributeRector.php @@ -43,7 +43,7 @@ final class AnnotationToAttributeRector extends AbstractRector implements Config /** * @var string */ - public const ANNOTATION_TO_ATTRIBUTE = 'annotations_to_attributes'; + final public const ANNOTATION_TO_ATTRIBUTE = 'annotations_to_attributes'; /** * @var AnnotationToAttribute[] diff --git a/rules/Php80/Rector/Class_/DoctrineAnnotationClassToAttributeRector.php b/rules/Php80/Rector/Class_/DoctrineAnnotationClassToAttributeRector.php index 1ddb1048b42..c52c25f76a5 100644 --- a/rules/Php80/Rector/Class_/DoctrineAnnotationClassToAttributeRector.php +++ b/rules/Php80/Rector/Class_/DoctrineAnnotationClassToAttributeRector.php @@ -40,7 +40,7 @@ final class DoctrineAnnotationClassToAttributeRector extends AbstractRector impl /** * @var string */ - public const REMOVE_ANNOTATIONS = 'remove_annotations'; + final public const REMOVE_ANNOTATIONS = 'remove_annotations'; /** * @var string diff --git a/rules/Privatization/Rector/MethodCall/ReplaceStringWithClassConstantRector.php b/rules/Privatization/Rector/MethodCall/ReplaceStringWithClassConstantRector.php index 78eaa8d8c8e..41096977b38 100644 --- a/rules/Privatization/Rector/MethodCall/ReplaceStringWithClassConstantRector.php +++ b/rules/Privatization/Rector/MethodCall/ReplaceStringWithClassConstantRector.php @@ -23,7 +23,7 @@ final class ReplaceStringWithClassConstantRector extends AbstractRector implemen /** * @var string */ - public const REPLACE_STRING_WITH_CLASS_CONSTANT = 'replace_string_with_class_constant'; + final public const REPLACE_STRING_WITH_CLASS_CONSTANT = 'replace_string_with_class_constant'; /** * @var ReplaceStringWithClassConstant[] diff --git a/rules/Removing/Rector/ClassMethod/ArgumentRemoverRector.php b/rules/Removing/Rector/ClassMethod/ArgumentRemoverRector.php index 8d436132d36..968e069ba01 100644 --- a/rules/Removing/Rector/ClassMethod/ArgumentRemoverRector.php +++ b/rules/Removing/Rector/ClassMethod/ArgumentRemoverRector.php @@ -25,7 +25,7 @@ final class ArgumentRemoverRector extends AbstractRector implements Configurable /** * @var string */ - public const REMOVED_ARGUMENTS = 'removed_arguments'; + final public const REMOVED_ARGUMENTS = 'removed_arguments'; /** * @var ArgumentRemover[] diff --git a/rules/Removing/Rector/Class_/RemoveInterfacesRector.php b/rules/Removing/Rector/Class_/RemoveInterfacesRector.php index e9cb21c402e..714172028aa 100644 --- a/rules/Removing/Rector/Class_/RemoveInterfacesRector.php +++ b/rules/Removing/Rector/Class_/RemoveInterfacesRector.php @@ -20,7 +20,7 @@ final class RemoveInterfacesRector extends AbstractRector implements Configurabl /** * @var string */ - public const INTERFACES_TO_REMOVE = 'interfaces_to_remove'; + final public const INTERFACES_TO_REMOVE = 'interfaces_to_remove'; /** * @var string[] diff --git a/rules/Removing/Rector/Class_/RemoveParentRector.php b/rules/Removing/Rector/Class_/RemoveParentRector.php index 84b382940b8..a5bfb53578c 100644 --- a/rules/Removing/Rector/Class_/RemoveParentRector.php +++ b/rules/Removing/Rector/Class_/RemoveParentRector.php @@ -24,7 +24,7 @@ final class RemoveParentRector extends AbstractRector implements ConfigurableRec * @api * @var string */ - public const PARENT_TYPES_TO_REMOVE = 'parents_types_to_remove'; + final public const PARENT_TYPES_TO_REMOVE = 'parents_types_to_remove'; /** * @var string[] diff --git a/rules/Removing/Rector/Class_/RemoveTraitUseRector.php b/rules/Removing/Rector/Class_/RemoveTraitUseRector.php index a47ff4bb4ca..e30199f00a6 100644 --- a/rules/Removing/Rector/Class_/RemoveTraitUseRector.php +++ b/rules/Removing/Rector/Class_/RemoveTraitUseRector.php @@ -22,7 +22,7 @@ final class RemoveTraitUseRector extends AbstractRector implements ConfigurableR /** * @var string */ - public const TRAITS_TO_REMOVE = 'traits_to_remove'; + final public const TRAITS_TO_REMOVE = 'traits_to_remove'; private bool $classHasChanged = false; diff --git a/rules/Removing/Rector/FuncCall/RemoveFuncCallArgRector.php b/rules/Removing/Rector/FuncCall/RemoveFuncCallArgRector.php index eebf0e882ad..0f63066bca8 100644 --- a/rules/Removing/Rector/FuncCall/RemoveFuncCallArgRector.php +++ b/rules/Removing/Rector/FuncCall/RemoveFuncCallArgRector.php @@ -22,7 +22,7 @@ final class RemoveFuncCallArgRector extends AbstractRector implements Configurab /** * @var string */ - public const REMOVED_FUNCTION_ARGUMENTS = 'removed_function_arguments'; + final public const REMOVED_FUNCTION_ARGUMENTS = 'removed_function_arguments'; /** * @var RemoveFuncCallArg[] diff --git a/rules/Removing/Rector/FuncCall/RemoveFuncCallRector.php b/rules/Removing/Rector/FuncCall/RemoveFuncCallRector.php index 1bef89bda21..23ec86bc94b 100644 --- a/rules/Removing/Rector/FuncCall/RemoveFuncCallRector.php +++ b/rules/Removing/Rector/FuncCall/RemoveFuncCallRector.php @@ -24,7 +24,7 @@ final class RemoveFuncCallRector extends AbstractRector implements ConfigurableR * @api * @var string */ - public const REMOVE_FUNC_CALLS = 'remove_func_calls'; + final public const REMOVE_FUNC_CALLS = 'remove_func_calls'; /** * @var RemoveFuncCall[] diff --git a/rules/Renaming/Rector/ClassConstFetch/RenameClassConstFetchRector.php b/rules/Renaming/Rector/ClassConstFetch/RenameClassConstFetchRector.php index e26dd138705..94f4474c197 100644 --- a/rules/Renaming/Rector/ClassConstFetch/RenameClassConstFetchRector.php +++ b/rules/Renaming/Rector/ClassConstFetch/RenameClassConstFetchRector.php @@ -25,7 +25,7 @@ final class RenameClassConstFetchRector extends AbstractRector implements Config /** * @var string */ - public const CLASS_CONSTANT_RENAME = 'constant_rename'; + final public const CLASS_CONSTANT_RENAME = 'constant_rename'; /** * @var RenameClassConstFetchInterface[] diff --git a/rules/Renaming/Rector/ClassMethod/RenameAnnotationRector.php b/rules/Renaming/Rector/ClassMethod/RenameAnnotationRector.php index 7ee9c0ec4c0..1c13c2a3963 100644 --- a/rules/Renaming/Rector/ClassMethod/RenameAnnotationRector.php +++ b/rules/Renaming/Rector/ClassMethod/RenameAnnotationRector.php @@ -26,7 +26,7 @@ final class RenameAnnotationRector extends AbstractRector implements Configurabl /** * @var string */ - public const RENAMED_ANNOTATIONS = 'renamed_annotations'; + final public const RENAMED_ANNOTATIONS = 'renamed_annotations'; /** * @var RenameAnnotationInterface[] diff --git a/rules/Renaming/Rector/ConstFetch/RenameConstantRector.php b/rules/Renaming/Rector/ConstFetch/RenameConstantRector.php index e687b845b20..914072d622c 100644 --- a/rules/Renaming/Rector/ConstFetch/RenameConstantRector.php +++ b/rules/Renaming/Rector/ConstFetch/RenameConstantRector.php @@ -21,7 +21,7 @@ final class RenameConstantRector extends AbstractRector implements ConfigurableR /** * @var string */ - public const OLD_TO_NEW_CONSTANTS = 'old_to_new_constants'; + final public const OLD_TO_NEW_CONSTANTS = 'old_to_new_constants'; /** * @var array diff --git a/rules/Renaming/Rector/FileWithoutNamespace/PseudoNamespaceToNamespaceRector.php b/rules/Renaming/Rector/FileWithoutNamespace/PseudoNamespaceToNamespaceRector.php index 33aa71eb8a2..837c6f38e84 100644 --- a/rules/Renaming/Rector/FileWithoutNamespace/PseudoNamespaceToNamespaceRector.php +++ b/rules/Renaming/Rector/FileWithoutNamespace/PseudoNamespaceToNamespaceRector.php @@ -32,7 +32,7 @@ final class PseudoNamespaceToNamespaceRector extends AbstractRector implements C /** * @var string */ - public const NAMESPACE_PREFIXES_WITH_EXCLUDED_CLASSES = 'namespace_prefixed_with_excluded_classes'; + final public const NAMESPACE_PREFIXES_WITH_EXCLUDED_CLASSES = 'namespace_prefixed_with_excluded_classes'; /** * @see https://regex101.com/r/chvLgs/1/ diff --git a/rules/Renaming/Rector/FuncCall/RenameFunctionRector.php b/rules/Renaming/Rector/FuncCall/RenameFunctionRector.php index db6e05dd6ce..be8e19a189b 100644 --- a/rules/Renaming/Rector/FuncCall/RenameFunctionRector.php +++ b/rules/Renaming/Rector/FuncCall/RenameFunctionRector.php @@ -23,7 +23,7 @@ final class RenameFunctionRector extends AbstractRector implements ConfigurableR /** * @var string */ - public const OLD_FUNCTION_TO_NEW_FUNCTION = 'old_function_to_new_function'; + final public const OLD_FUNCTION_TO_NEW_FUNCTION = 'old_function_to_new_function'; /** * @var array diff --git a/rules/Renaming/Rector/MethodCall/RenameMethodRector.php b/rules/Renaming/Rector/MethodCall/RenameMethodRector.php index f3eeaddc2aa..17c5d2e88f8 100644 --- a/rules/Renaming/Rector/MethodCall/RenameMethodRector.php +++ b/rules/Renaming/Rector/MethodCall/RenameMethodRector.php @@ -31,7 +31,7 @@ final class RenameMethodRector extends AbstractRector implements ConfigurableRec /** * @var string */ - public const METHOD_CALL_RENAMES = 'method_call_renames'; + final public const METHOD_CALL_RENAMES = 'method_call_renames'; /** * @var MethodCallRenameInterface[] diff --git a/rules/Renaming/Rector/Name/RenameClassRector.php b/rules/Renaming/Rector/Name/RenameClassRector.php index 45143bd93ca..bea0195f7bc 100644 --- a/rules/Renaming/Rector/Name/RenameClassRector.php +++ b/rules/Renaming/Rector/Name/RenameClassRector.php @@ -31,7 +31,7 @@ final class RenameClassRector extends AbstractRector implements ConfigurableRect /** * @var string */ - public const OLD_TO_NEW_CLASSES = 'old_to_new_classes'; + final public const OLD_TO_NEW_CLASSES = 'old_to_new_classes'; public function __construct( private readonly RenamedClassesDataCollector $renamedClassesDataCollector, diff --git a/rules/Renaming/Rector/Namespace_/RenameNamespaceRector.php b/rules/Renaming/Rector/Namespace_/RenameNamespaceRector.php index 59cfc6dd194..57c4c0968ac 100644 --- a/rules/Renaming/Rector/Namespace_/RenameNamespaceRector.php +++ b/rules/Renaming/Rector/Namespace_/RenameNamespaceRector.php @@ -29,7 +29,7 @@ final class RenameNamespaceRector extends AbstractRector implements Configurable /** * @var string */ - public const OLD_TO_NEW_NAMESPACES = 'old_to_new_namespaces'; + final public const OLD_TO_NEW_NAMESPACES = 'old_to_new_namespaces'; /** * @var array diff --git a/rules/Renaming/Rector/PropertyFetch/RenamePropertyRector.php b/rules/Renaming/Rector/PropertyFetch/RenamePropertyRector.php index d913615459d..a8d051c8cad 100644 --- a/rules/Renaming/Rector/PropertyFetch/RenamePropertyRector.php +++ b/rules/Renaming/Rector/PropertyFetch/RenamePropertyRector.php @@ -28,7 +28,7 @@ final class RenamePropertyRector extends AbstractRector implements ConfigurableR /** * @var string */ - public const RENAMED_PROPERTIES = 'old_to_new_property_by_types'; + final public const RENAMED_PROPERTIES = 'old_to_new_property_by_types'; /** * @var RenameProperty[] diff --git a/rules/Renaming/Rector/StaticCall/RenameStaticMethodRector.php b/rules/Renaming/Rector/StaticCall/RenameStaticMethodRector.php index e922cb75bff..b112215964f 100644 --- a/rules/Renaming/Rector/StaticCall/RenameStaticMethodRector.php +++ b/rules/Renaming/Rector/StaticCall/RenameStaticMethodRector.php @@ -23,7 +23,7 @@ final class RenameStaticMethodRector extends AbstractRector implements Configura /** * @var string */ - public const OLD_TO_NEW_METHODS_BY_CLASSES = 'old_to_new_method_by_classes'; + final public const OLD_TO_NEW_METHODS_BY_CLASSES = 'old_to_new_method_by_classes'; /** * @var string diff --git a/rules/Renaming/Rector/String_/RenameStringRector.php b/rules/Renaming/Rector/String_/RenameStringRector.php index e284a181d26..1d103ed2f2c 100644 --- a/rules/Renaming/Rector/String_/RenameStringRector.php +++ b/rules/Renaming/Rector/String_/RenameStringRector.php @@ -22,7 +22,7 @@ final class RenameStringRector extends AbstractRector implements ConfigurableRec /** * @var string */ - public const STRING_CHANGES = 'string_changes'; + final public const STRING_CHANGES = 'string_changes'; /** * @var array diff --git a/rules/Restoration/Rector/Namespace_/CompleteImportForPartialAnnotationRector.php b/rules/Restoration/Rector/Namespace_/CompleteImportForPartialAnnotationRector.php index b22da88218b..c4530a3dd26 100644 --- a/rules/Restoration/Rector/Namespace_/CompleteImportForPartialAnnotationRector.php +++ b/rules/Restoration/Rector/Namespace_/CompleteImportForPartialAnnotationRector.php @@ -27,7 +27,7 @@ final class CompleteImportForPartialAnnotationRector extends AbstractRector impl * @api * @var string */ - public const USE_IMPORTS_TO_RESTORE = '$useImportsToRestore'; + final public const USE_IMPORTS_TO_RESTORE = '$useImportsToRestore'; /** * @var CompleteImportForPartialAnnotation[] diff --git a/rules/Strict/Rector/AbstractFalsyScalarRuleFixerRector.php b/rules/Strict/Rector/AbstractFalsyScalarRuleFixerRector.php index 7861eadcc5f..67a6df6e458 100644 --- a/rules/Strict/Rector/AbstractFalsyScalarRuleFixerRector.php +++ b/rules/Strict/Rector/AbstractFalsyScalarRuleFixerRector.php @@ -16,7 +16,7 @@ abstract class AbstractFalsyScalarRuleFixerRector extends AbstractRector impleme /** * @var string */ - public const TREAT_AS_NON_EMPTY = 'treat_as_non_empty'; + final public const TREAT_AS_NON_EMPTY = 'treat_as_non_empty'; protected bool $treatAsNonEmpty = false; diff --git a/rules/Transform/Rector/Assign/DimFetchAssignToMethodCallRector.php b/rules/Transform/Rector/Assign/DimFetchAssignToMethodCallRector.php index 4b2705a5b19..7afa87eb733 100644 --- a/rules/Transform/Rector/Assign/DimFetchAssignToMethodCallRector.php +++ b/rules/Transform/Rector/Assign/DimFetchAssignToMethodCallRector.php @@ -25,7 +25,7 @@ final class DimFetchAssignToMethodCallRector extends AbstractRector implements C /** * @var string */ - public const DIM_FETCH_ASSIGN_TO_METHOD_CALL = 'dim_fetch_assign_to_method_call'; + final public const DIM_FETCH_ASSIGN_TO_METHOD_CALL = 'dim_fetch_assign_to_method_call'; /** * @var DimFetchAssignToMethodCall[] diff --git a/rules/Transform/Rector/Assign/GetAndSetToMethodCallRector.php b/rules/Transform/Rector/Assign/GetAndSetToMethodCallRector.php index a9949b48eb7..87b430c06bf 100644 --- a/rules/Transform/Rector/Assign/GetAndSetToMethodCallRector.php +++ b/rules/Transform/Rector/Assign/GetAndSetToMethodCallRector.php @@ -29,7 +29,7 @@ final class GetAndSetToMethodCallRector extends AbstractRector implements Config /** * @var string */ - public const TYPE_TO_METHOD_CALLS = 'type_to_method_calls'; + final public const TYPE_TO_METHOD_CALLS = 'type_to_method_calls'; /** * @var GetAndSetToMethodCall[] diff --git a/rules/Transform/Rector/Assign/PropertyAssignToMethodCallRector.php b/rules/Transform/Rector/Assign/PropertyAssignToMethodCallRector.php index 79b79fc2a5e..7153a9502c7 100644 --- a/rules/Transform/Rector/Assign/PropertyAssignToMethodCallRector.php +++ b/rules/Transform/Rector/Assign/PropertyAssignToMethodCallRector.php @@ -23,7 +23,7 @@ final class PropertyAssignToMethodCallRector extends AbstractRector implements C /** * @var string */ - public const PROPERTY_ASSIGNS_TO_METHODS_CALLS = 'property_assigns_to_methods_calls'; + final public const PROPERTY_ASSIGNS_TO_METHODS_CALLS = 'property_assigns_to_methods_calls'; /** * @var PropertyAssignToMethodCall[] diff --git a/rules/Transform/Rector/Assign/PropertyFetchToMethodCallRector.php b/rules/Transform/Rector/Assign/PropertyFetchToMethodCallRector.php index a803287b81d..81a5c117ab3 100644 --- a/rules/Transform/Rector/Assign/PropertyFetchToMethodCallRector.php +++ b/rules/Transform/Rector/Assign/PropertyFetchToMethodCallRector.php @@ -24,7 +24,7 @@ final class PropertyFetchToMethodCallRector extends AbstractRector implements Co /** * @var string */ - public const PROPERTIES_TO_METHOD_CALLS = 'properties_to_method_calls'; + final public const PROPERTIES_TO_METHOD_CALLS = 'properties_to_method_calls'; /** * @var PropertyFetchToMethodCall[] diff --git a/rules/Transform/Rector/Attribute/AttributeKeyToClassConstFetchRector.php b/rules/Transform/Rector/Attribute/AttributeKeyToClassConstFetchRector.php index 6912048b6a2..d115cd04ee8 100644 --- a/rules/Transform/Rector/Attribute/AttributeKeyToClassConstFetchRector.php +++ b/rules/Transform/Rector/Attribute/AttributeKeyToClassConstFetchRector.php @@ -24,7 +24,7 @@ final class AttributeKeyToClassConstFetchRector extends AbstractRector implement /** * @var string */ - public const ATTRIBUTE_KEYS_TO_CLASS_CONST_FETCHES = 'attribute_keys_to_class_const_fetches'; + final public const ATTRIBUTE_KEYS_TO_CLASS_CONST_FETCHES = 'attribute_keys_to_class_const_fetches'; /** * @var AttributeKeyToClassConstFetch[] diff --git a/rules/Transform/Rector/ClassMethod/SingleToManyMethodRector.php b/rules/Transform/Rector/ClassMethod/SingleToManyMethodRector.php index d86a975d3b7..5295e4e21a5 100644 --- a/rules/Transform/Rector/ClassMethod/SingleToManyMethodRector.php +++ b/rules/Transform/Rector/ClassMethod/SingleToManyMethodRector.php @@ -28,7 +28,7 @@ final class SingleToManyMethodRector extends AbstractRector implements Configura * @api * @var string */ - public const SINGLES_TO_MANY_METHODS = 'singles_to_many_methods'; + final public const SINGLES_TO_MANY_METHODS = 'singles_to_many_methods'; /** * @var SingleToManyMethod[] diff --git a/rules/Transform/Rector/ClassMethod/WrapReturnRector.php b/rules/Transform/Rector/ClassMethod/WrapReturnRector.php index 42d87cf2bef..1f89f519a01 100644 --- a/rules/Transform/Rector/ClassMethod/WrapReturnRector.php +++ b/rules/Transform/Rector/ClassMethod/WrapReturnRector.php @@ -24,7 +24,7 @@ final class WrapReturnRector extends AbstractRector implements ConfigurableRecto /** * @var string */ - public const TYPE_METHOD_WRAPS = 'type_method_wraps'; + final public const TYPE_METHOD_WRAPS = 'type_method_wraps'; /** * @var WrapReturn[] diff --git a/rules/Transform/Rector/Class_/AddInterfaceByParentRector.php b/rules/Transform/Rector/Class_/AddInterfaceByParentRector.php index 7044a23f160..7200af93b23 100644 --- a/rules/Transform/Rector/Class_/AddInterfaceByParentRector.php +++ b/rules/Transform/Rector/Class_/AddInterfaceByParentRector.php @@ -24,7 +24,7 @@ final class AddInterfaceByParentRector extends AbstractRector implements Configu /** * @var string */ - public const INTERFACE_BY_PARENT = 'interface_by_parent'; + final public const INTERFACE_BY_PARENT = 'interface_by_parent'; /** * @var array diff --git a/rules/Transform/Rector/Class_/AddInterfaceByTraitRector.php b/rules/Transform/Rector/Class_/AddInterfaceByTraitRector.php index 0955cef476e..d1cb59859ce 100644 --- a/rules/Transform/Rector/Class_/AddInterfaceByTraitRector.php +++ b/rules/Transform/Rector/Class_/AddInterfaceByTraitRector.php @@ -24,7 +24,7 @@ final class AddInterfaceByTraitRector extends AbstractRector implements Configur /** * @var string */ - public const INTERFACE_BY_TRAIT = 'interface_by_trait'; + final public const INTERFACE_BY_TRAIT = 'interface_by_trait'; /** * @var array diff --git a/rules/Transform/Rector/Class_/MergeInterfacesRector.php b/rules/Transform/Rector/Class_/MergeInterfacesRector.php index 741210c8b3d..d45b78ad2a9 100644 --- a/rules/Transform/Rector/Class_/MergeInterfacesRector.php +++ b/rules/Transform/Rector/Class_/MergeInterfacesRector.php @@ -26,7 +26,7 @@ final class MergeInterfacesRector extends AbstractRector implements Configurable * @api * @var string */ - public const OLD_TO_NEW_INTERFACES = 'old_to_new_interfaces'; + final public const OLD_TO_NEW_INTERFACES = 'old_to_new_interfaces'; /** * @var array diff --git a/rules/Transform/Rector/Class_/ParentClassToTraitsRector.php b/rules/Transform/Rector/Class_/ParentClassToTraitsRector.php index 1fd3a16eb0e..278b3d044be 100644 --- a/rules/Transform/Rector/Class_/ParentClassToTraitsRector.php +++ b/rules/Transform/Rector/Class_/ParentClassToTraitsRector.php @@ -27,7 +27,7 @@ final class ParentClassToTraitsRector extends AbstractRector implements Configur /** * @var string */ - public const PARENT_CLASS_TO_TRAITS = 'parent_class_to_traits'; + final public const PARENT_CLASS_TO_TRAITS = 'parent_class_to_traits'; /** * @var ParentClassToTraits[] diff --git a/rules/Transform/Rector/FuncCall/ArgumentFuncCallToMethodCallRector.php b/rules/Transform/Rector/FuncCall/ArgumentFuncCallToMethodCallRector.php index d5303b64ff4..48fb4ed7a28 100644 --- a/rules/Transform/Rector/FuncCall/ArgumentFuncCallToMethodCallRector.php +++ b/rules/Transform/Rector/FuncCall/ArgumentFuncCallToMethodCallRector.php @@ -35,7 +35,7 @@ final class ArgumentFuncCallToMethodCallRector extends AbstractRector implements /** * @var string */ - public const FUNCTIONS_TO_METHOD_CALLS = 'functions_to_method_calls'; + final public const FUNCTIONS_TO_METHOD_CALLS = 'functions_to_method_calls'; /** * @var ArgumentFuncCallToMethodCallInterface[] diff --git a/rules/Transform/Rector/FuncCall/FuncCallToConstFetchRector.php b/rules/Transform/Rector/FuncCall/FuncCallToConstFetchRector.php index 76f0ef779eb..9be7b112731 100644 --- a/rules/Transform/Rector/FuncCall/FuncCallToConstFetchRector.php +++ b/rules/Transform/Rector/FuncCall/FuncCallToConstFetchRector.php @@ -22,7 +22,7 @@ final class FuncCallToConstFetchRector extends AbstractRector implements Configu /** * @var string */ - public const FUNCTIONS_TO_CONSTANTS = 'functions_to_constants'; + final public const FUNCTIONS_TO_CONSTANTS = 'functions_to_constants'; /** * @var string[] diff --git a/rules/Transform/Rector/FuncCall/FuncCallToMethodCallRector.php b/rules/Transform/Rector/FuncCall/FuncCallToMethodCallRector.php index a6de1f39447..c0270228b8e 100644 --- a/rules/Transform/Rector/FuncCall/FuncCallToMethodCallRector.php +++ b/rules/Transform/Rector/FuncCall/FuncCallToMethodCallRector.php @@ -24,7 +24,7 @@ final class FuncCallToMethodCallRector extends AbstractRector implements Configu /** * @var string */ - public const FUNC_CALL_TO_CLASS_METHOD_CALL = 'function_to_class_to_method_call'; + final public const FUNC_CALL_TO_CLASS_METHOD_CALL = 'function_to_class_to_method_call'; /** * @var FuncCallToMethodCall[] diff --git a/rules/Transform/Rector/FuncCall/FuncCallToNewRector.php b/rules/Transform/Rector/FuncCall/FuncCallToNewRector.php index 8da1796f8b1..1bdfae2e880 100644 --- a/rules/Transform/Rector/FuncCall/FuncCallToNewRector.php +++ b/rules/Transform/Rector/FuncCall/FuncCallToNewRector.php @@ -22,7 +22,7 @@ final class FuncCallToNewRector extends AbstractRector implements ConfigurableRe /** * @var string */ - public const FUNCTIONS_TO_NEWS = 'functions_to_news'; + final public const FUNCTIONS_TO_NEWS = 'functions_to_news'; /** * @var string[] diff --git a/rules/Transform/Rector/FuncCall/FuncCallToStaticCallRector.php b/rules/Transform/Rector/FuncCall/FuncCallToStaticCallRector.php index b1b31d0ca29..d446f286d22 100644 --- a/rules/Transform/Rector/FuncCall/FuncCallToStaticCallRector.php +++ b/rules/Transform/Rector/FuncCall/FuncCallToStaticCallRector.php @@ -21,7 +21,7 @@ final class FuncCallToStaticCallRector extends AbstractRector implements Configu /** * @var string */ - public const FUNC_CALLS_TO_STATIC_CALLS = 'func_calls_to_static_calls'; + final public const FUNC_CALLS_TO_STATIC_CALLS = 'func_calls_to_static_calls'; /** * @var FuncCallToStaticCall[] diff --git a/rules/Transform/Rector/Isset_/UnsetAndIssetToMethodCallRector.php b/rules/Transform/Rector/Isset_/UnsetAndIssetToMethodCallRector.php index 7fa73ef2863..4d15a07e13f 100644 --- a/rules/Transform/Rector/Isset_/UnsetAndIssetToMethodCallRector.php +++ b/rules/Transform/Rector/Isset_/UnsetAndIssetToMethodCallRector.php @@ -23,7 +23,7 @@ final class UnsetAndIssetToMethodCallRector extends AbstractRector implements Co /** * @var string */ - public const ISSET_UNSET_TO_METHOD_CALL = 'isset_unset_to_method_call'; + final public const ISSET_UNSET_TO_METHOD_CALL = 'isset_unset_to_method_call'; /** * @var UnsetAndIssetToMethodCall[] diff --git a/rules/Transform/Rector/MethodCall/CallableInMethodCallToVariableRector.php b/rules/Transform/Rector/MethodCall/CallableInMethodCallToVariableRector.php index 3f7918aa9d1..4ed618be75d 100644 --- a/rules/Transform/Rector/MethodCall/CallableInMethodCallToVariableRector.php +++ b/rules/Transform/Rector/MethodCall/CallableInMethodCallToVariableRector.php @@ -27,7 +27,7 @@ final class CallableInMethodCallToVariableRector extends AbstractRector implemen /** * @var string */ - public const CALLABLE_IN_METHOD_CALL_TO_VARIABLE = 'callable_in_method_call_to_variable'; + final public const CALLABLE_IN_METHOD_CALL_TO_VARIABLE = 'callable_in_method_call_to_variable'; /** * @var CallableInMethodCallToVariable[] diff --git a/rules/Transform/Rector/MethodCall/MethodCallToAnotherMethodCallWithArgumentsRector.php b/rules/Transform/Rector/MethodCall/MethodCallToAnotherMethodCallWithArgumentsRector.php index 9ea68e4031a..d5b327e0b4a 100644 --- a/rules/Transform/Rector/MethodCall/MethodCallToAnotherMethodCallWithArgumentsRector.php +++ b/rules/Transform/Rector/MethodCall/MethodCallToAnotherMethodCallWithArgumentsRector.php @@ -22,7 +22,7 @@ final class MethodCallToAnotherMethodCallWithArgumentsRector extends AbstractRec /** * @var string */ - public const METHOD_CALL_RENAMES_WITH_ADDED_ARGUMENTS = 'method_call_renames_with_added_arguments'; + final public const METHOD_CALL_RENAMES_WITH_ADDED_ARGUMENTS = 'method_call_renames_with_added_arguments'; /** * @var MethodCallToAnotherMethodCallWithArguments[] diff --git a/rules/Transform/Rector/MethodCall/MethodCallToMethodCallRector.php b/rules/Transform/Rector/MethodCall/MethodCallToMethodCallRector.php index f8816e709ae..171cd97e3c3 100644 --- a/rules/Transform/Rector/MethodCall/MethodCallToMethodCallRector.php +++ b/rules/Transform/Rector/MethodCall/MethodCallToMethodCallRector.php @@ -29,7 +29,7 @@ final class MethodCallToMethodCallRector extends AbstractRector implements Confi /** * @var string */ - public const METHOD_CALLS_TO_METHOD_CALLS = 'method_calls_to_method_calls'; + final public const METHOD_CALLS_TO_METHOD_CALLS = 'method_calls_to_method_calls'; /** * @var MethodCallToMethodCall[] diff --git a/rules/Transform/Rector/MethodCall/MethodCallToPropertyFetchRector.php b/rules/Transform/Rector/MethodCall/MethodCallToPropertyFetchRector.php index 60fb0da1a80..7eae2ccb259 100644 --- a/rules/Transform/Rector/MethodCall/MethodCallToPropertyFetchRector.php +++ b/rules/Transform/Rector/MethodCall/MethodCallToPropertyFetchRector.php @@ -21,7 +21,7 @@ final class MethodCallToPropertyFetchRector extends AbstractRector implements Co * @api * @var string */ - public const METHOD_CALL_TO_PROPERTY_FETCHES = 'method_call_to_property_fetch_collection'; + final public const METHOD_CALL_TO_PROPERTY_FETCHES = 'method_call_to_property_fetch_collection'; /** * @var array diff --git a/rules/Transform/Rector/MethodCall/MethodCallToStaticCallRector.php b/rules/Transform/Rector/MethodCall/MethodCallToStaticCallRector.php index c8f460b34a4..5f7a00b3dda 100644 --- a/rules/Transform/Rector/MethodCall/MethodCallToStaticCallRector.php +++ b/rules/Transform/Rector/MethodCall/MethodCallToStaticCallRector.php @@ -21,7 +21,7 @@ final class MethodCallToStaticCallRector extends AbstractRector implements Confi /** * @var string */ - public const METHOD_CALLS_TO_STATIC_CALLS = 'method_calls_to_static_calls'; + final public const METHOD_CALLS_TO_STATIC_CALLS = 'method_calls_to_static_calls'; /** * @var MethodCallToStaticCall[] diff --git a/rules/Transform/Rector/MethodCall/ReplaceParentCallByPropertyCallRector.php b/rules/Transform/Rector/MethodCall/ReplaceParentCallByPropertyCallRector.php index b569e0459ee..afc5287eca2 100644 --- a/rules/Transform/Rector/MethodCall/ReplaceParentCallByPropertyCallRector.php +++ b/rules/Transform/Rector/MethodCall/ReplaceParentCallByPropertyCallRector.php @@ -21,7 +21,7 @@ final class ReplaceParentCallByPropertyCallRector extends AbstractRector impleme /** * @var string */ - public const PARENT_CALLS_TO_PROPERTIES = 'parent_calls_to_properties'; + final public const PARENT_CALLS_TO_PROPERTIES = 'parent_calls_to_properties'; /** * @var ReplaceParentCallByPropertyCall[] diff --git a/rules/Transform/Rector/MethodCall/ServiceGetterToConstructorInjectionRector.php b/rules/Transform/Rector/MethodCall/ServiceGetterToConstructorInjectionRector.php index 9f841af8cbf..3b197c08e15 100644 --- a/rules/Transform/Rector/MethodCall/ServiceGetterToConstructorInjectionRector.php +++ b/rules/Transform/Rector/MethodCall/ServiceGetterToConstructorInjectionRector.php @@ -30,7 +30,7 @@ final class ServiceGetterToConstructorInjectionRector extends AbstractRector imp /** * @var string */ - public const METHOD_CALL_TO_SERVICES = 'method_call_to_services'; + final public const METHOD_CALL_TO_SERVICES = 'method_call_to_services'; /** * @var ServiceGetterToConstructorInjection[] diff --git a/rules/Transform/Rector/New_/NewArgToMethodCallRector.php b/rules/Transform/Rector/New_/NewArgToMethodCallRector.php index 96a6e77d085..096b1bb15f2 100644 --- a/rules/Transform/Rector/New_/NewArgToMethodCallRector.php +++ b/rules/Transform/Rector/New_/NewArgToMethodCallRector.php @@ -25,7 +25,7 @@ final class NewArgToMethodCallRector extends AbstractRector implements Configura /** * @var string */ - public const NEW_ARGS_TO_METHOD_CALLS = 'new_args_to_method_calls'; + final public const NEW_ARGS_TO_METHOD_CALLS = 'new_args_to_method_calls'; /** * @var NewArgToMethodCall[] diff --git a/rules/Transform/Rector/New_/NewToConstructorInjectionRector.php b/rules/Transform/Rector/New_/NewToConstructorInjectionRector.php index d9279badabe..50cef483189 100644 --- a/rules/Transform/Rector/New_/NewToConstructorInjectionRector.php +++ b/rules/Transform/Rector/New_/NewToConstructorInjectionRector.php @@ -31,7 +31,7 @@ final class NewToConstructorInjectionRector extends AbstractRector implements Co /** * @var string */ - public const TYPES_TO_CONSTRUCTOR_INJECTION = 'types_to_constructor_injection'; + final public const TYPES_TO_CONSTRUCTOR_INJECTION = 'types_to_constructor_injection'; /** * @var ObjectType[] diff --git a/rules/Transform/Rector/New_/NewToMethodCallRector.php b/rules/Transform/Rector/New_/NewToMethodCallRector.php index f4571830c7e..8ec704606b3 100644 --- a/rules/Transform/Rector/New_/NewToMethodCallRector.php +++ b/rules/Transform/Rector/New_/NewToMethodCallRector.php @@ -29,7 +29,7 @@ final class NewToMethodCallRector extends AbstractRector implements Configurable /** * @var string */ - public const NEWS_TO_METHOD_CALLS = 'news_to_method_calls'; + final public const NEWS_TO_METHOD_CALLS = 'news_to_method_calls'; /** * @var NewToMethodCall[] diff --git a/rules/Transform/Rector/New_/NewToStaticCallRector.php b/rules/Transform/Rector/New_/NewToStaticCallRector.php index db72a2cf1e0..19cd29d3f15 100644 --- a/rules/Transform/Rector/New_/NewToStaticCallRector.php +++ b/rules/Transform/Rector/New_/NewToStaticCallRector.php @@ -21,7 +21,7 @@ final class NewToStaticCallRector extends AbstractRector implements Configurable /** * @var string */ - public const TYPE_TO_STATIC_CALLS = 'type_to_static_calls'; + final public const TYPE_TO_STATIC_CALLS = 'type_to_static_calls'; /** * @var NewToStaticCall[] diff --git a/rules/Transform/Rector/StaticCall/StaticCallToFuncCallRector.php b/rules/Transform/Rector/StaticCall/StaticCallToFuncCallRector.php index 87b2260fa79..0554acf0d70 100644 --- a/rules/Transform/Rector/StaticCall/StaticCallToFuncCallRector.php +++ b/rules/Transform/Rector/StaticCall/StaticCallToFuncCallRector.php @@ -23,7 +23,7 @@ final class StaticCallToFuncCallRector extends AbstractRector implements Configu /** * @var string */ - public const STATIC_CALLS_TO_FUNCTIONS = 'static_calls_to_functions'; + final public const STATIC_CALLS_TO_FUNCTIONS = 'static_calls_to_functions'; /** * @param StaticCallToFuncCall[] $staticCallsToFunctions diff --git a/rules/Transform/Rector/StaticCall/StaticCallToMethodCallRector.php b/rules/Transform/Rector/StaticCall/StaticCallToMethodCallRector.php index c9fb1b42369..cb85489ef46 100644 --- a/rules/Transform/Rector/StaticCall/StaticCallToMethodCallRector.php +++ b/rules/Transform/Rector/StaticCall/StaticCallToMethodCallRector.php @@ -29,7 +29,7 @@ final class StaticCallToMethodCallRector extends AbstractRector implements Confi * @api * @var string */ - public const STATIC_CALLS_TO_METHOD_CALLS = 'static_calls_to_method_calls'; + final public const STATIC_CALLS_TO_METHOD_CALLS = 'static_calls_to_method_calls'; /** * @var StaticCallToMethodCall[] diff --git a/rules/Transform/Rector/StaticCall/StaticCallToNewRector.php b/rules/Transform/Rector/StaticCall/StaticCallToNewRector.php index 09db31b6374..0f9fb169c41 100644 --- a/rules/Transform/Rector/StaticCall/StaticCallToNewRector.php +++ b/rules/Transform/Rector/StaticCall/StaticCallToNewRector.php @@ -25,7 +25,7 @@ final class StaticCallToNewRector extends AbstractRector implements Configurable /** * @var string */ - public const STATIC_CALLS_TO_NEWS = 'static_calls_to_news'; + final public const STATIC_CALLS_TO_NEWS = 'static_calls_to_news'; /** * @var StaticCallToNew[] diff --git a/rules/Transform/Rector/String_/StringToClassConstantRector.php b/rules/Transform/Rector/String_/StringToClassConstantRector.php index b622a62dcdc..37cb5a6d82d 100644 --- a/rules/Transform/Rector/String_/StringToClassConstantRector.php +++ b/rules/Transform/Rector/String_/StringToClassConstantRector.php @@ -21,7 +21,7 @@ final class StringToClassConstantRector extends AbstractRector implements Config /** * @var string */ - public const STRINGS_TO_CLASS_CONSTANTS = 'strings_to_class_constants'; + final public const STRINGS_TO_CLASS_CONSTANTS = 'strings_to_class_constants'; /** * @var StringToClassConstant[] diff --git a/rules/Transform/Rector/String_/ToStringToMethodCallRector.php b/rules/Transform/Rector/String_/ToStringToMethodCallRector.php index 94a5c53b438..b8ab4a980f7 100644 --- a/rules/Transform/Rector/String_/ToStringToMethodCallRector.php +++ b/rules/Transform/Rector/String_/ToStringToMethodCallRector.php @@ -24,7 +24,7 @@ final class ToStringToMethodCallRector extends AbstractRector implements Configu * @api * @var string */ - public const METHOD_NAMES_BY_TYPE = 'method_names_by_type'; + final public const METHOD_NAMES_BY_TYPE = 'method_names_by_type'; /** * @var array diff --git a/rules/TypeDeclaration/Rector/ClassMethod/AddParamTypeDeclarationRector.php b/rules/TypeDeclaration/Rector/ClassMethod/AddParamTypeDeclarationRector.php index a3217625477..e50f4d8e73f 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/AddParamTypeDeclarationRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/AddParamTypeDeclarationRector.php @@ -30,7 +30,7 @@ final class AddParamTypeDeclarationRector extends AbstractRector implements Conf /** * @var string */ - public const PARAMETER_TYPEHINTS = 'parameter_typehints'; + final public const PARAMETER_TYPEHINTS = 'parameter_typehints'; /** * @var AddParamTypeDeclaration[] diff --git a/rules/TypeDeclaration/Rector/ClassMethod/AddReturnTypeDeclarationRector.php b/rules/TypeDeclaration/Rector/ClassMethod/AddReturnTypeDeclarationRector.php index 91a398d592b..639d4fec7d9 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/AddReturnTypeDeclarationRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/AddReturnTypeDeclarationRector.php @@ -26,7 +26,7 @@ final class AddReturnTypeDeclarationRector extends AbstractRector implements Con /** * @var string */ - public const METHOD_RETURN_TYPES = 'method_return_types'; + final public const METHOD_RETURN_TYPES = 'method_return_types'; /** * @var AddReturnTypeDeclaration[] diff --git a/rules/TypeDeclaration/Rector/ClassMethod/AddVoidReturnTypeWhereNoReturnRector.php b/rules/TypeDeclaration/Rector/ClassMethod/AddVoidReturnTypeWhereNoReturnRector.php index 26c24d0ed2d..804728dde66 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/AddVoidReturnTypeWhereNoReturnRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/AddVoidReturnTypeWhereNoReturnRector.php @@ -29,7 +29,7 @@ final class AddVoidReturnTypeWhereNoReturnRector extends AbstractRector implemen /** * @var string using phpdoc instead of a native void type can ease the migration path for consumers of code beeing processed. */ - public const USE_PHPDOC = 'use_phpdoc'; + final public const USE_PHPDOC = 'use_phpdoc'; private bool $usePhpdoc = false; diff --git a/rules/Visibility/Rector/ClassConst/ChangeConstantVisibilityRector.php b/rules/Visibility/Rector/ClassConst/ChangeConstantVisibilityRector.php index 1a886427403..0b58e757c19 100644 --- a/rules/Visibility/Rector/ClassConst/ChangeConstantVisibilityRector.php +++ b/rules/Visibility/Rector/ClassConst/ChangeConstantVisibilityRector.php @@ -23,7 +23,7 @@ final class ChangeConstantVisibilityRector extends AbstractRector implements Con /** * @var string */ - public const CLASS_CONSTANT_VISIBILITY_CHANGES = 'class_constant_visibility_changes'; + final public const CLASS_CONSTANT_VISIBILITY_CHANGES = 'class_constant_visibility_changes'; /** * @var ChangeConstantVisibility[] diff --git a/rules/Visibility/Rector/ClassMethod/ChangeMethodVisibilityRector.php b/rules/Visibility/Rector/ClassMethod/ChangeMethodVisibilityRector.php index 89a282b31c5..6b6a7f636e7 100644 --- a/rules/Visibility/Rector/ClassMethod/ChangeMethodVisibilityRector.php +++ b/rules/Visibility/Rector/ClassMethod/ChangeMethodVisibilityRector.php @@ -26,7 +26,7 @@ final class ChangeMethodVisibilityRector extends AbstractRector implements Confi /** * @var string */ - public const METHOD_VISIBILITIES = 'method_visibilities'; + final public const METHOD_VISIBILITIES = 'method_visibilities'; /** * @var ChangeMethodVisibility[] From e711caf0d5e51a50cafcb624c4925b4ed13f3a03 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 2 Dec 2021 18:59:18 +0700 Subject: [PATCH 07/13] try update fork url --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 612bf2ee7b6..66588b1d2bf 100644 --- a/composer.json +++ b/composer.json @@ -170,7 +170,7 @@ "repositories" : [ { "type" : "vcs", - "url" : "https://github.com/samsonasik/Stringy", + "url" : "https://github.com/samsonasik/Stringy.git", "no-api": true } ], From d0e65bcdae2bf7699f6f2336cbbdbaeafebe4fa7 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 2 Dec 2021 19:18:46 +0700 Subject: [PATCH 08/13] update stringy with vendor-patches --- composer.json | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 66588b1d2bf..a3af63f28ec 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "clue/ndjson-react": "^1.2", "composer/semver": "^3.2", "composer/xdebug-handler": "^2.0", - "danielstjules/stringy": "dev-php81-return-type-willchange as 3.1.0", + "danielstjules/stringy": "^3.1", "doctrine/inflector": "^2.0", "ergebnis/json-printer": "^3.1", "idiosyncratic/editorconfig": "^0.1.3", @@ -167,13 +167,6 @@ "sort-packages": true, "platform-check": false }, - "repositories" : [ - { - "type" : "vcs", - "url" : "https://github.com/samsonasik/Stringy.git", - "no-api": true - } - ], "minimum-stability": "dev", "prefer-stable": true } From 7decf493486aaee9dafef4e1969dc85f04ba75c0 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 2 Dec 2021 20:26:18 +0700 Subject: [PATCH 09/13] set php 8.0 on build scoped due #[\ReturnTypeWillChange] on php-scoper.phar --- .github/workflows/build_scoped_rector.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_scoped_rector.yaml b/.github/workflows/build_scoped_rector.yaml index 12a334b2ea9..40e8ccb6bb8 100644 --- a/.github/workflows/build_scoped_rector.yaml +++ b/.github/workflows/build_scoped_rector.yaml @@ -35,7 +35,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.0 coverage: none # fixes https://github.com/rectorphp/rector/pull/4559/checks?check_run_id=1359814403, see https://github.com/shivammathur/setup-php#composer-github-oauth From 39f158adb4cc13358606a42cc8d24f678ac4c048 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Fri, 3 Dec 2021 20:49:29 +0700 Subject: [PATCH 10/13] enable MyCLabsClassToEnumRector and SpatieEnumClassToEnumRector in config set, but skip in rector.php --- config/set/php81.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/set/php81.php b/config/set/php81.php index f541b21df71..6ba848f02a0 100644 --- a/config/set/php81.php +++ b/config/set/php81.php @@ -17,11 +17,11 @@ return static function (ContainerConfigurator $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ReturnNeverTypeRector::class); - //$services->set(MyCLabsClassToEnumRector::class); + $services->set(MyCLabsClassToEnumRector::class); $services->set(MyCLabsMethodCallToEnumConstRector::class); $services->set(FinalizePublicClassConstantRector::class); $services->set(ReadOnlyPropertyRector::class); - //$services->set(SpatieEnumClassToEnumRector::class); + $services->set(SpatieEnumClassToEnumRector::class); $services->set(Php81ResourceReturnToObjectRector::class); $services->set(NewInInitializerRector::class); $services->set(IntersectionTypesRector::class); From b9f0cde1c1c9d4918f818cc3f4fa1c799b01072a Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sat, 4 Dec 2021 13:10:50 +0700 Subject: [PATCH 11/13] downgrade from php 8.1, scoping from php 8.0 --- .github/workflows/build_scoped_rector.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_scoped_rector.yaml b/.github/workflows/build_scoped_rector.yaml index 40e8ccb6bb8..12a334b2ea9 100644 --- a/.github/workflows/build_scoped_rector.yaml +++ b/.github/workflows/build_scoped_rector.yaml @@ -35,7 +35,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: 8.0 + php-version: 8.1 coverage: none # fixes https://github.com/rectorphp/rector/pull/4559/checks?check_run_id=1359814403, see https://github.com/shivammathur/setup-php#composer-github-oauth From 982c544ca38ca0664e82ea7eda546d5f64542191 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sat, 4 Dec 2021 19:37:51 +0700 Subject: [PATCH 12/13] clean rector.php --- rector.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/rector.php b/rector.php index 63096f5af65..e7cca970488 100644 --- a/rector.php +++ b/rector.php @@ -13,15 +13,10 @@ use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector; use Rector\Php81\Rector\Class_\MyCLabsClassToEnumRector; use Rector\Php81\Rector\Class_\SpatieEnumClassToEnumRector; -use Rector\Php81\Rector\ClassConst\FinalizePublicClassConstantRector; -use Rector\Php81\Rector\FuncCall\Php81ResourceReturnToObjectRector; -use Rector\Php81\Rector\FunctionLike\IntersectionTypesRector; -use Rector\Php81\Rector\MethodCall\MyCLabsMethodCallToEnumConstRector; use Rector\PHPUnit\Set\PHPUnitSetList; use Rector\Privatization\Rector\Class_\FinalizeClassesWithoutChildrenRector; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; -use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return static function (ContainerConfigurator $containerConfigurator): void { @@ -85,13 +80,6 @@ MyCLabsClassToEnumRector::class, SpatieEnumClassToEnumRector::class, - // temporary skip non new in initialization rector - ReturnNeverTypeRector::class, - FinalizePublicClassConstantRector::class, - MyCLabsMethodCallToEnumConstRector::class, - Php81ResourceReturnToObjectRector::class, - IntersectionTypesRector::class, - // test paths '*/tests/**/Fixture/*', '*/rules-tests/**/Fixture/*', From 17908e3c18f899c56c934e6c7a771b2d406bd9be Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 4 Dec 2021 15:46:09 +0000 Subject: [PATCH 13/13] [ci-review] Rector Rectify --- rector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rector.php b/rector.php index 585c7dda79e..e7cca970488 100644 --- a/rector.php +++ b/rector.php @@ -79,7 +79,7 @@ MyCLabsClassToEnumRector::class, SpatieEnumClassToEnumRector::class, - + // test paths '*/tests/**/Fixture/*', '*/rules-tests/**/Fixture/*',