Add regex uri to regex constant (#4504)

Co-authored-by: Jan Lohage <j2L4e@users.noreply.github.com>
Co-authored-by: rector-bot <tomas@getrector.org>
This commit is contained in:
Abdul Malik Ikhsan 2020-10-30 01:04:33 +07:00 committed by GitHub
parent 252f17821e
commit 449801e1f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
76 changed files with 116 additions and 121 deletions

View File

@ -41,6 +41,7 @@ final class StaticEasyPrefixer
/**
* @var string
* @see https://regex101.com/r/P8sXfr/1
*/
private const QUOTED_VALUE_REGEX = '#\'\\\\(\w|@)#';

View File

@ -15,6 +15,7 @@ final class JetbrainsStubsRenamer
{
/**
* @var string
* @see https://regex101.com/r/K7XJBF/1
*/
private const PHP_SUFFIX_COMMA_REGEX = '#\.php\',#m';

View File

@ -16,6 +16,7 @@ final class AttributeAwareTemplateTagValueNode extends TemplateTagValueNode impl
/**
* @var string
* @see https://regex101.com/r/4WtsUS/1
*/
private const AS_OF_PREPOSITOIN_REGEX = '#\s+(?<preposition>as|of)\s+#';

View File

@ -16,6 +16,7 @@ final class AttributeAwareUnionTypeNode extends UnionTypeNode implements Attribu
/**
* @var string
* @see https://regex101.com/r/Hwk7Cg/1
*/
private const BRACKET_WRAPPING_REGEX = '#^\((.*?)\)#';

View File

@ -20,16 +20,19 @@ abstract class AbstractPhpDocNodeFactory
{
/**
* @var string
* @see https://regex101.com/r/548EJJ/1
*/
private const CLASS_CONST_REGEX = '#::class#';
/**
* @var string
* @see https://regex101.com/r/CsmMaz/1
*/
private const OPENING_SPACE_REGEX = '#^\{(?<opening_space>\s+)#';
/**
* @var string
* @see https://regex101.com/r/Rrbi3V/1
*/
private const CLOSING_SPACE_REGEX = '#(?<closing_space>\s+)\}$#';

View File

@ -12,6 +12,7 @@ final class IndexPhpDocNodeFactory
{
/**
* @var string
* @see https://regex101.com/r/wkjfUt/1
*/
private const INDEX_REGEX = '#(?<tag>@(ORM\\\\)?Index)\((?<content>.*?)\),?#si';

View File

@ -19,6 +19,7 @@ final class TablePhpDocNodeFactory extends AbstractPhpDocNodeFactory implements
{
/**
* @var string
* @see https://regex101.com/r/HKjBVt/1
*/
private const SPACE_BEFORE_CLOSING_BRACKET_REGEX = '#,(\s+)?}$#m';

View File

@ -13,6 +13,7 @@ final class UniqueConstraintPhpDocNodeFactory
{
/**
* @var string
* @see https://regex101.com/r/ZBL6Uf/1
*/
private const UNIQUE_CONSTRAINT_REGEX = '#(?<tag>@(ORM\\\\)?UniqueConstraint)\((?<content>.*?)\),?#si';

View File

@ -30,6 +30,7 @@ final class JoinTablePhpDocNodeFactory extends AbstractPhpDocNodeFactory impleme
/**
* @var string
* @see https://regex101.com/r/5JVito/1
*/
private const JOIN_COLUMN_REGEX = '#(?<tag>@(ORM\\\\)?JoinColumn)\((?<content>.*?)\),?#si';

View File

@ -14,6 +14,7 @@ final class AnnotationContentResolver
{
/**
* @var string
* @see https://regex101.com/r/D3sbiI/1
*/
private const MULTILINE_COMENT_ASTERISK_REGEX = '#(\s+)\*(\s+)#m';

View File

@ -36,6 +36,7 @@ final class BetterPhpDocParser extends PhpDocParser
{
/**
* @var string
* @see https://regex101.com/r/HlGzME/1
*/
private const TAG_REGEX = '#@(var|param|return|throws|property|deprecated)#';

View File

@ -18,6 +18,7 @@ final class MultilineSpaceFormatPreserver
{
/**
* @var string
* @see https://regex101.com/r/R2zdQt/1
*/
public const NEWLINE_WITH_SPACE_REGEX = '#\n {1,}$#s';

View File

@ -12,6 +12,7 @@ final class OriginalSpacingRestorer
{
/**
* @var string
* @see https://regex101.com/r/TMk388/1
*/
public const WHITESPACE_SPLIT_REGEX = '#\s+(\*)?#';

View File

@ -28,6 +28,7 @@ final class PhpDocInfoPrinter
{
/**
* @var string
* @see https://regex101.com/r/Ab0Vey/1
*/
public const CLOSING_DOCBLOCK_REGEX = '#\*\/(\s+)?$#';
@ -38,21 +39,25 @@ final class PhpDocInfoPrinter
/**
* @var string
* @see https://regex101.com/r/mVmOCY/2
*/
private const OPENING_DOCBLOCK_REGEX = '#^(/\*\*)#';
/**
* @var string
* @see https://regex101.com/r/5fJyws/1
*/
private const CALLABLE_REGEX = '#callable(\s+)\(#';
/**
* @var string
* @see https://regex101.com/r/LLWiPl/1
*/
private const DOCBLOCK_START_REGEX = '#^(\/\/|\/\*\*|\/\*|\#)#';
/**
* @var string
* @see https://regex101.com/r/hFwSMz/1
*/
private const SPACE_AFTER_ASTERISK_REGEX = '#([^*])\*[ \t]+$#sm';

View File

@ -16,6 +16,7 @@ final class WhitespaceDetector
{
/**
* @var string
* @see https://regex101.com/r/w7yAt8/1
*/
private const SPACE_BEFORE_ASTERISK_REGEX = '#\s+\*#m';

View File

@ -14,11 +14,13 @@ final class ArrayItemStaticHelper
{
/**
* @var string
* @see https://regex101.com/r/Yn4EqP/1
*/
private const NON_EMPTY_SILENT_KEY_REGEX = '#()|\(\)#';
/**
* @var string
* @see https://regex101.com/r/wcrm9D/1
*/
private const ITEM_EQUALS_REGEX = '#(?<item>\w+)(\s+)?=(\s+)?#m';

View File

@ -20,21 +20,25 @@ final class TagValueNodeConfigurationFactory
{
/**
* @var string
* @see https://regex101.com/r/y3U6s4/1
*/
public const NEWLINE_AFTER_OPENING_REGEX = '#^(\(\s+|\n)#m';
/**
* @var string
* @see https://regex101.com/r/bopnKI/1
*/
public const NEWLINE_BEFORE_CLOSING_REGEX = '#(\s+\)|\n(\s+)?)$#m';
/**
* @var string
* @see https://regex101.com/r/IMT6GF/1
*/
public const OPENING_BRACKET_REGEX = '#^\(#';
/**
* @var string
* @see https://regex101.com/r/nsFq7m/1
*/
public const CLOSING_BRACKET_REGEX = '#\)$#';

View File

@ -25,6 +25,7 @@ final class ConsoleOutputFormatter implements OutputFormatterInterface
/**
* @var string
* @see https://regex101.com/r/q8I66g/1
*/
private const ON_LINE_REGEX = '# on line #';

View File

@ -11,11 +11,13 @@ final class MarkdownDifferAndFormatter
{
/**
* @var string
* @see https://regex101.com/r/LE9Xwo/1
*/
private const METADATA_REGEX = '#^(.*\n){1}#';
/**
* @var string
* @see https://regex101.com/r/yf7u2L/1
*/
private const SPACE_AND_NEWLINE_REGEX = '#( ){1,}\n#';

View File

@ -35,6 +35,7 @@ final class PHPStanNodeScopeResolver
{
/**
* @var string
* @see https://regex101.com/r/aXsCkK/1
*/
private const ANONYMOUS_CLASS_START_REGEX = '#^AnonymousClass(\w+)#';

View File

@ -22,16 +22,19 @@ final class DocBlockManipulator
{
/**
* @var string
* @see https://regex101.com/r/VdaVGL/1
*/
public const SPACE_OR_ASTERISK_REGEX = '#(\s|\*)+#';
/**
* @var string
* @see https://regex101.com/r/Mjb0qi/1
*/
private const NEWLINE_CLOSING_DOC_REGEX = "#\n \*\/$#";
/**
* @var string
* @see https://regex101.com/r/U5OUV4/2
*/
private const NEWLINE_MIDDLE_DOC_REGEX = "#\n \* #";

View File

@ -10,6 +10,7 @@ final class JsonStringFormatter
{
/**
* @var string
* @see https://regex101.com/r/T0Aq6F/1
*/
private const REPLACE_REGEX = '#(?<start>"authors": \[\s+)(?<content>.*?)(?<end>\s+\](,))#ms';

View File

@ -14,16 +14,19 @@ final class TemplateFileSystem
{
/**
* @var string
* @see https://regex101.com/r/fw3jBe/1
*/
private const FIXTURE_SHORT_REGEX = '#/Fixture/#';
/**
* @var string
* @see https://regex101.com/r/HBcfXd/1
*/
private const PACKAGE_RULES_PATH_REGEX = '#(packages|rules)\/__package__#i';
/**
* @var string
* @see https://regex101.com/r/tOidWU/1
*/
private const CONFIGURED_OR_EXTRA_REGEX = '#(__Configured|__Extra)#';

View File

@ -15,6 +15,7 @@ final class FileGenerator
{
/**
* @var string
* @see https://regex101.com/r/RVbPEX/1
*/
public const RECTOR_UTILS_REGEX = '#Rector\\\\Utils#';

View File

@ -18,6 +18,7 @@ final class RectorSetProvider extends AbstractSetProvider
{
/**
* @var string
* @see https://regex101.com/r/8gO8w6/1
*/
private const DASH_NUMBER_REGEX = '#\-(\d+)#';

View File

@ -652,124 +652,6 @@ parameters:
- src/HttpKernel/RectorKernel.php # 71
- src/Testing/NodeVisitor/AttributeCollectingNodeVisitor.php # 24
-
message: '#Add regex101\.com link to that shows the regex in practise, so it will be easier to maintain in case of bug/extension in the future#'
paths:
- compiler/src/PhpScoper/StaticEasyPrefixer.php # 45
- compiler/src/Renaming/JetbrainsStubsRenamer.php # 19
- packages/attribute-aware-php-doc/src/Ast/PhpDoc/AttributeAwareTemplateTagValueNode.php # 20
- packages/attribute-aware-php-doc/src/Ast/Type/AttributeAwareUnionTypeNode.php # 20
- packages/better-php-doc-parser/src/PhpDocNodeFactory/AbstractPhpDocNodeFactory.php # 24
- packages/better-php-doc-parser/src/PhpDocNodeFactory/AbstractPhpDocNodeFactory.php # 29
- packages/better-php-doc-parser/src/PhpDocNodeFactory/AbstractPhpDocNodeFactory.php # 34
- packages/better-php-doc-parser/src/PhpDocNodeFactory/Doctrine/Class_/IndexPhpDocNodeFactory.php # 16
- packages/better-php-doc-parser/src/PhpDocNodeFactory/Doctrine/Class_/TablePhpDocNodeFactory.php # 23
- packages/better-php-doc-parser/src/PhpDocNodeFactory/Doctrine/Class_/UniqueConstraintPhpDocNodeFactory.php # 17
- packages/better-php-doc-parser/src/PhpDocNodeFactory/Doctrine/Property_/JoinTablePhpDocNodeFactory.php # 34
- packages/better-php-doc-parser/src/PhpDocParser/AnnotationContentResolver.php # 18
- packages/better-php-doc-parser/src/PhpDocParser/BetterPhpDocParser.php # 40
- packages/better-php-doc-parser/src/Printer/MultilineSpaceFormatPreserver.php # 22
- packages/better-php-doc-parser/src/Printer/OriginalSpacingRestorer.php # 16
- packages/better-php-doc-parser/src/Printer/PhpDocInfoPrinter.php # 32
- packages/better-php-doc-parser/src/Printer/PhpDocInfoPrinter.php # 42
- packages/better-php-doc-parser/src/Printer/PhpDocInfoPrinter.php # 47
- packages/better-php-doc-parser/src/Printer/PhpDocInfoPrinter.php # 52
- packages/better-php-doc-parser/src/Printer/PhpDocInfoPrinter.php # 57
- packages/better-php-doc-parser/src/Printer/WhitespaceDetector.php # 20
- packages/better-php-doc-parser/src/Utils/ArrayItemStaticHelper.php # 18
- packages/better-php-doc-parser/src/Utils/ArrayItemStaticHelper.php # 23
- packages/better-php-doc-parser/src/ValueObjectFactory/TagValueNodeConfigurationFactory.php # 24
- packages/better-php-doc-parser/src/ValueObjectFactory/TagValueNodeConfigurationFactory.php # 29
- packages/better-php-doc-parser/src/ValueObjectFactory/TagValueNodeConfigurationFactory.php # 34
- packages/better-php-doc-parser/src/ValueObjectFactory/TagValueNodeConfigurationFactory.php # 39
- packages/changes-reporting/src/Output/ConsoleOutputFormatter.php # 29
- packages/console-differ/src/MarkdownDifferAndFormatter.php # 15
- packages/console-differ/src/MarkdownDifferAndFormatter.php # 20
- packages/node-type-resolver/src/PHPStan/Scope/PHPStanNodeScopeResolver.php # 39
- packages/node-type-resolver/src/PhpDoc/NodeAnalyzer/DocBlockManipulator.php # 26
- packages/node-type-resolver/src/PhpDoc/NodeAnalyzer/DocBlockManipulator.php # 31
- packages/node-type-resolver/src/PhpDoc/NodeAnalyzer/DocBlockManipulator.php # 36
- packages/rector-generator/src/FileSystem/JsonStringFormatter.php # 14
- packages/rector-generator/src/FileSystem/TemplateFileSystem.php # 18
- packages/rector-generator/src/FileSystem/TemplateFileSystem.php # 23
- packages/rector-generator/src/FileSystem/TemplateFileSystem.php # 28
- packages/rector-generator/src/Generator/FileGenerator.php # 19
- packages/set/src/RectorSetProvider.php # 22
- rules/autodiscovery/src/Rector/FileSystem/MoveEntitiesToEntityDirectoryRector.php # 28
- rules/cakephp/src/Naming/CakePHPFullyQualifiedClassNameResolver.php # 18
- rules/cakephp/src/Naming/CakePHPFullyQualifiedClassNameResolver.php # 23
- rules/cakephp/src/Naming/CakePHPFullyQualifiedClassNameResolver.php # 28
- rules/coding-style/src/Imports/ShortNameResolver.php # 32
- rules/coding-style/src/Node/DocAliasResolver.php # 21
- rules/coding-style/src/Rector/Assign/ManualJsonStringToJsonEncodeArrayRector.php # 45
- rules/coding-style/src/Rector/Catch_/CatchExceptionNameMatchingTypeRector.php # 23
- rules/coding-style/src/Rector/ClassMethod/RemoveDoubleUnderscoreInMethodNameRector.php # 28
- rules/coding-style/src/Rector/FuncCall/ConsistentPregDelimiterRector.php # 34
- rules/coding-style/src/Rector/FuncCall/VersionCompareFuncCallToConstantRector.php # 54
- rules/coding-style/src/Rector/String_/SymplifyQuoteEscapeRector.php # 23
- rules/doctrine/src/Mapper/DefaultDoctrineEntityAndRepositoryMapper.php # 20
- rules/doctrine/src/Mapper/DefaultDoctrineEntityAndRepositoryMapper.php # 25
- rules/doctrine/src/NodeFactory/EntityUuidNodeFactory.php # 30
- rules/doctrine/src/NodeFactory/EntityUuidNodeFactory.php # 35
- rules/doctrine/src/PhpDocParser/DoctrineDocBlockResolver.php # 28
- rules/doctrine/src/Provider/EntityWithMissingUuidProvider.php # 23
- rules/generic/src/Rector/Property/InjectAnnotationClassRector.php # 54
- rules/naming/src/Guard/BreakingVariableRenameGuard.php # 38
- rules/naming/src/Guard/DateTimeAtNamingConventionGuard.php # 20
- rules/naming/src/Naming/PropertyNaming.php # 53
- rules/nette-tester-to-phpunit/src/Rector/RenameTesterTestToPHPUnitToTestFileRector.php # 21
- rules/nette-tester-to-phpunit/src/Rector/RenameTesterTestToPHPUnitToTestFileRector.php # 26
- rules/nette-to-symfony/src/Rector/ClassMethod/RouterListToControllerAnnotationsRector.php # 39
- rules/nette-to-symfony/src/Rector/MethodCall/WrapTransParameterNameRector.php # 27
- rules/php-spec-to-phpunit/src/Rector/FileSystem/RenameSpecFileToTestFileRector.php # 23
- rules/php-spec-to-phpunit/src/Rector/FileSystem/RenameSpecFileToTestFileRector.php # 28
- rules/php55/src/NodeFactory/AnonymousFunctionNodeFactory.php # 27
- rules/php55/src/RegexMatcher.php # 19
- rules/php55/src/RegexMatcher.php # 24
- rules/php70/src/EregToPcreTransformer.php # 39
- rules/php70/src/Rector/FunctionLike/ExceptionHandlerTypehintRector.php # 28
- rules/php72/src/Rector/ConstFetch/BarewordStringRector.php # 26
- rules/php73/src/Rector/FuncCall/RegexDashEscapeRector.php # 27
- rules/phpstan/src/Rector/Assign/PHPStormVarAnnotationRector.php # 28
- rules/phpstan/src/Rector/Assign/PHPStormVarAnnotationRector.php # 33
- rules/phpstan/src/Rector/Assign/PHPStormVarAnnotationRector.php # 38
- rules/phpunit/src/Rector/ClassMethod/AddDoesNotPerformAssertionToNonAssertingTestRector.php # 38
- rules/privatization/src/Rector/ClassMethod/PrivatizeLocalOnlyMethodRector.php # 28
- rules/privatization/src/Rector/ClassMethod/PrivatizeLocalOnlyMethodRector.php # 33
- rules/sensio/src/Helper/TemplateGuesser.php # 22
- rules/sensio/src/Helper/TemplateGuesser.php # 27
- rules/sensio/src/Helper/TemplateGuesser.php # 32
- rules/sensio/src/Helper/TemplateGuesser.php # 37
- rules/sensio/src/Helper/TemplateGuesser.php # 42
- rules/solid/src/Rector/Class_/RepeatedLiteralToClassConstantRector.php # 50
- rules/symfony-code-quality/src/Rector/Class_/EventListenerToEventSubscriberRector.php # 55
- rules/symfony-code-quality/src/Rector/Class_/EventListenerToEventSubscriberRector.php # 60
- rules/symfony/src/Rector/StaticCall/ParseFileRector.php # 26
- rules/symfony/src/Rector/StaticCall/ParseFileRector.php # 31
- rules/symfony/src/Rector/StaticCall/ParseFileRector.php # 36
- src/Configuration/OnlyRuleResolver.php # 18
- src/Exclusion/Check/ExcludeByDocBlockExclusionCheck.php # 25
- src/FileSystem/FilesFinder.php # 24
- src/FileSystem/FilesFinder.php # 29
- src/NodeAnalyzer/ClassNodeAnalyzer.php # 17
- src/Php/TypeAnalyzer.php # 20
- src/Php/TypeAnalyzer.php # 25
- src/PhpDoc/PhpDocTagsFinder.php # 21
- src/PhpParser/NodeTransformer.php # 24
- src/PhpParser/Parser/InlineCodeParser.php # 26
- src/PhpParser/Parser/InlineCodeParser.php # 31
- src/PhpParser/Printer/BetterStandardPrinter.php # 39
- src/PhpParser/Printer/BetterStandardPrinter.php # 44
- src/PhpParser/Printer/BetterStandardPrinter.php # 49
- src/PhpParser/Printer/BetterStandardPrinter.php # 54
- src/Rector/AbstractPHPUnitRector.php # 19
- src/Skip/Skipper.php # 18
- src/Skip/Skipper.php # 23
- src/Util/StaticRectorStrings.php # 22
- utils/phpstan-extensions/src/Rule/RectorRuleAndValueObjectHaveSameStartsRule.php # 33
- utils/phpstan-static-type-mapper-checker/src/Finder/PHPStanTypeClassFinder.php # 15
- utils/project-validator/src/Process/ParallelTaskRunner.php # 19
- '#Parameter \#1 \$node of method Rector\\DeadCode\\Rector\\Plus\\RemoveDeadZeroAndOneOperationRector\:\:refactor\(\) expects PhpParser\\Node\\Expr\\AssignOp\\Div\|PhpParser\\Node\\Expr\\AssignOp\\Minus\|PhpParser\\Node\\Expr\\AssignOp\\Mul\|PhpParser\\Node\\Expr\\AssignOp\\Plus\|PhpParser\\Node\\Expr\\BinaryOp\\Div\|PhpParser\\Node\\Expr\\BinaryOp\\Minus\|PhpParser\\Node\\Expr\\BinaryOp\\Mul\|PhpParser\\Node\\Expr\\BinaryOp\\Plus, PhpParser\\Node\\Expr\\AssignOp\|PhpParser\\Node\\Expr\\BinaryOp given#'
- '#Cognitive complexity for "Rector\\CodeQuality\\Naming\\MethodCallToVariableNameResolver\:\:resolveVariableName\(\)" is 12, keep it under 9#'

View File

@ -24,6 +24,7 @@ final class MoveEntitiesToEntityDirectoryRector extends AbstractFileMovingFileSy
{
/**
* @var string
* @see https://regex101.com/r/auSMk3/1
*/
private const ENTITY_PATH_REGEX = '#\bEntity\b#';

View File

@ -14,16 +14,19 @@ final class CakePHPFullyQualifiedClassNameResolver
{
/**
* @var string
* @see https://regex101.com/r/mbvKJp/1
*/
public const LIB_NAMESPACE_PART_REGEX = '#\\\\Lib\\\\#';
/**
* @var string
* @see https://regex101.com/r/XvoZIP/1
*/
private const SLASH_REGEX = '#(/|\.)#';
/**
* @var string
* @see https://regex101.com/r/lq0lQ9/1
*/
private const PLUGIN_OR_LIB_REGEX = '#(Plugin|Lib)#';

View File

@ -28,6 +28,7 @@ final class ShortNameResolver
{
/**
* @var string
* @see https://regex101.com/r/KphLd2/1
*/
private const BIG_LETTER_START_REGEX = '#^[A-Z]#';

View File

@ -17,6 +17,7 @@ final class DocAliasResolver
{
/**
* @var string
* @see https://regex101.com/r/cWpliJ/1
*/
private const DOC_ALIAS_REGEX = '#\@(?<possible_alias>\w+)(\\\\)?#s';

View File

@ -41,6 +41,7 @@ final class ManualJsonStringToJsonEncodeArrayRector extends AbstractRector
/**
* @var string
* @see https://regex101.com/r/jdJ6n9/1
*/
private const JSON_STRING_REGEX = '#{(.*?\:.*?)}#s';

View File

@ -18,7 +18,7 @@ final class CatchExceptionNameMatchingTypeRector extends AbstractRector
{
/**
* @var string
* @link https://regex101.com/r/xmfMAX/1
* @see https://regex101.com/r/xmfMAX/1
*/
private const STARTS_WITH_ABBREVIATION_REGEX = '#^([A-Za-z]+?)([A-Z]{1}[a-z]{1})([A-Za-z]*)#';

View File

@ -24,8 +24,9 @@ final class RemoveDoubleUnderscoreInMethodNameRector extends AbstractRector
{
/**
* @var string
* @see https://regex101.com/r/oRrhDJ/2
*/
private const DOUBLE_UNDERSCORE_START_REGEX = '#__(.*?)#';
private const DOUBLE_UNDERSCORE_START_REGEX = '#^__(.*?)#';
public function getDefinition(): RectorDefinition
{

View File

@ -28,6 +28,7 @@ final class ConsistentPregDelimiterRector extends AbstractRector implements Conf
/**
* @var string
* @see https://regex101.com/r/isdgEN/1
*
* For modifiers see https://www.php.net/manual/en/reference.pcre.pattern.modifiers.php
*/

View File

@ -50,6 +50,7 @@ final class VersionCompareFuncCallToConstantRector extends AbstractRector
/**
* @var string
* @see https://regex101.com/r/yl9g25/1
*/
private const SEMANTIC_VERSION_REGEX = '#^\d+\.\d+\.\d+$#';

View File

@ -19,6 +19,7 @@ final class SymplifyQuoteEscapeRector extends AbstractRector
{
/**
* @var string
* @see https://regex101.com/r/qEkCe9/1
*/
private const ESCAPED_CHAR_REGEX = '#\\\\|\$#sim';

View File

@ -16,11 +16,13 @@ final class DefaultDoctrineEntityAndRepositoryMapper implements DoctrineEntityAn
/**
* @var string
* @see https://regex101.com/r/WrYZ0d/1
*/
private const REPOSITORY_REGEX = '#Repository#';
/**
* @var string
* @see https://regex101.com/r/2a2CY6/1
*/
private const ENTITY_REGEX = '#Entity#';

View File

@ -26,11 +26,13 @@ final class EntityUuidNodeFactory
{
/**
* @var string
* @see https://regex101.com/r/vQ8f2v/1
*/
private const SERIALIZER_SHORT_ANNOTATION_REGEX = '#(\@Serializer\\\\Type\(")(int)("\))#';
/**
* @var string
* @see https://regex101.com/r/AkLsy1/1
*/
private const ORM_VAR_DOC_LINE_REGEX = '#^(\s+)\*(\s+)\@(var|ORM)(.*?)$#ms';

View File

@ -24,6 +24,7 @@ final class DoctrineDocBlockResolver
{
/**
* @var string
* @see https://regex101.com/r/doLRPw/1
*/
private const ORM_ENTITY_EMBEDDABLE_SHORT_ANNOTATION_REGEX = '#@ORM\\\\(Entity|Embeddable)#';

View File

@ -19,6 +19,7 @@ final class EntityWithMissingUuidProvider
{
/**
* @var string
* @see https://regex101.com/r/3OnLHU/1
*/
private const UUID_PREFIX_REGEX = '#^uuid(_binary)?$#';

View File

@ -50,6 +50,7 @@ final class InjectAnnotationClassRector extends AbstractRector implements Config
/**
* @var string
* @see https://regex101.com/r/pjusUN/1
*/
private const BETWEEN_PERCENT_CHARS_REGEX = '#%(.*?)%#';

View File

@ -34,6 +34,7 @@ final class BreakingVariableRenameGuard
{
/**
* @var string
* @see https://regex101.com/r/1pKLgf/1
*/
private const AT_NAMING_REGEX = '#[\w+]At$#';

View File

@ -16,6 +16,7 @@ final class DateTimeAtNamingConventionGuard implements GuardInterface
{
/**
* @var string
* @see https://regex101.com/r/1pKLgf/1/
*/
private const AT_NAMING_REGEX = '#[\w+]At$#';

View File

@ -49,6 +49,7 @@ final class PropertyNaming
/**
* @var string
* @see https://regex101.com/r/U78rUF/1
*/
private const I_PREFIX_REGEX = '#^I[A-Z]#';

View File

@ -17,11 +17,13 @@ final class RenameTesterTestToPHPUnitToTestFileRector extends AbstractFileSystem
{
/**
* @var string
* @see https://regex101.com/r/ioamnE/1
*/
private const PHP_SUFFIX_REGEX = '#\.php$#';
/**
* @var string
* @see https://regex101.com/r/cOMZIj/1
*/
private const PHPT_SUFFIX_REGEX = '#\.phpt$#';

View File

@ -35,6 +35,7 @@ final class RouterListToControllerAnnotationsRector extends AbstractRector
{
/**
* @var string
* @see https://regex101.com/r/qVlXk2/2
*/
private const ACTION_RENDER_NAME_MATCHING_REGEX = '#^(action|render)(?<short_action_name>.*?$)#sm';

View File

@ -23,6 +23,7 @@ final class WrapTransParameterNameRector extends AbstractRector
{
/**
* @var string
* @see https://regex101.com/r/b8boED/1
*/
private const BETWEEN_PERCENT_CHARS_REGEX = '#%(.*?)%#';

View File

@ -19,11 +19,13 @@ final class RenameSpecFileToTestFileRector extends AbstractFileSystemRector
{
/**
* @var string
* @see https://regex101.com/r/r1VkPt/1
*/
private const SPEC_REGEX = '#\/spec\/#';
/**
* @var string
* @see https://regex101.com/r/WD4U43/1
*/
private const SPEC_SUFFIX_REGEX = '#Spec\.php$#';

View File

@ -23,6 +23,7 @@ final class AnonymousFunctionNodeFactory
{
/**
* @var string
* @see https://regex101.com/r/jkLLlM/2
*/
private const DIM_FETCH_REGEX = '#(\\$|\\\\|\\x0)(?<number>\d+)#';

View File

@ -15,11 +15,13 @@ final class RegexMatcher
{
/**
* @var string
* @see https://regex101.com/r/Ok4wuE/1
*/
private const LAST_E_REGEX = '#(\w+)?e(\w+)?$#';
/**
* @var string
* @see https://regex101.com/r/2NWVwT/1
*/
private const LETTER_SUFFIX_REGEX = '#(?<modifiers>\w+)$#';

View File

@ -35,6 +35,7 @@ final class EregToPcreTransformer
/**
* @var string
* @see https://regex101.com/r/htpXFg/1
*/
private const BOUND_REGEX = '/^(\d|[1-9]\d|1\d\d|
2[0-4]\d|25[0-5])

View File

@ -24,6 +24,7 @@ final class ExceptionHandlerTypehintRector extends AbstractRector
{
/**
* @var string
* @see https://regex101.com/r/VBFXCR/1
*/
private const HANDLE_INSENSITIVE_REGEX = '#handle#i';

View File

@ -22,6 +22,7 @@ final class BarewordStringRector extends AbstractRector
{
/**
* @var string
* @see https://regex101.com/r/jfIpz4/1
*/
private const UNDEFINED_CONSTANT_REGEX = '#Use of undefined constant (?<constant>\w+)#';

View File

@ -23,6 +23,7 @@ final class RegexDashEscapeRector extends AbstractRector
{
/**
* @var string
* @see https://regex101.com/r/YgVJFp/1
*/
private const LEFT_HAND_UNESCAPED_DASH_REGEX = '#(\[.*?\\\\(w|s|d))-(?!\])#i';

View File

@ -24,16 +24,19 @@ final class PHPStormVarAnnotationRector extends AbstractRector
{
/**
* @var string
* @see https://regex101.com/r/YY5stJ/1
*/
private const SINGLE_ASTERISK_COMMENT_START_REGEX = '#^\/\* #';
/**
* @var string
* @see https://regex101.com/r/meD7rP/1
*/
private const VAR_ANNOTATION_REGEX = '#\@var(\s)+\$#';
/**
* @var string
* @see https://regex101.com/r/yz2AZ7/1
*/
private const VARIABLE_NAME_AND_TYPE_MATCH_REGEX = '#(?<variableName>\$\w+)(?<space>\s+)(?<type>[\\\\\w]+)#';

View File

@ -34,6 +34,7 @@ final class AddDoesNotPerformAssertionToNonAssertingTestRector extends AbstractP
/**
* @var string
* @see https://regex101.com/r/pn4Kma/1
*/
private const DOES_NOT_PERFORM_ASSERTION_REGEX = '#@(doesNotPerformAssertion|expectedException\b)#';

View File

@ -24,11 +24,13 @@ final class PrivatizeLocalOnlyMethodRector extends AbstractRector implements Zer
{
/**
* @var string
* @see https://regex101.com/r/f97wwM/1
*/
private const COMMON_PUBLIC_METHOD_CONTROLLER_REGEX = '#^(render|action|handle|inject)#';
/**
* @var string
* @see https://regex101.com/r/FXhI9M/1
*/
private const CONTROLLER_PRESENTER_SUFFIX_REGEX = '#(Controller|Presenter)$#';

View File

@ -18,26 +18,31 @@ final class TemplateGuesser
{
/**
* @var string
* @see https://regex101.com/r/yZAUAC/1
*/
private const BUNDLE_SUFFIX_REGEX = '#Bundle$#';
/**
* @var string
* @see https://regex101.com/r/T6ItFG/1
*/
private const BUNDLE_NAME_MATCHING_REGEX = '#(?<bundle>[\w]*Bundle)#';
/**
* @var string
* @see https://regex101.com/r/5dNkCC/2
*/
private const SMALL_LETTER_BIG_LETTER_REGEX = '#([a-z\d])([A-Z])#';
/**
* @var string
* @see https://regex101.com/r/YUrmAD/1
*/
private const CONTROLLER_NAME_MATCH_REGEX = '#Controller\\\(.+)Controller$#';
/**
* @var string
* @see https://regex101.com/r/nj8Ojf/1
*/
private const ACTION_MATCH_REGEX = '#Action$#';

View File

@ -46,6 +46,7 @@ final class RepeatedLiteralToClassConstantRector extends AbstractRector
/**
* @var string
* @see https://regex101.com/r/osJLMF/1
*/
private const SLASH_AND_DASH_REGEX = '#[-\\\/]#';

View File

@ -51,11 +51,13 @@ final class EventListenerToEventSubscriberRector extends AbstractRector
/**
* @var string
* @see https://regex101.com/r/qiHZ4T/1
*/
private const LISTENER_MATCH_REGEX = '#^(.*?)(Listener)?$#';
/**
* @var string
* @see https://regex101.com/r/j6SAga/1
*/
private const SYMFONY_FAMILY_REGEX = '#^(Symfony|Sensio|Doctrine)\b#';

View File

@ -22,16 +22,19 @@ final class ParseFileRector extends AbstractRector
{
/**
* @var string
* @see https://regex101.com/r/ZaY42i/1
*/
private const YAML_SUFFIX_IN_QUOTE_REGEX = '#\.(yml|yaml)(\'|")$#';
/**
* @var string
* @see https://regex101.com/r/YHA05g/1
*/
private const FILE_SUFFIX_REGEX = '#\File$#';
/**
* @var string
* @see https://regex101.com/r/JmNhZj/1
*/
private const YAML_SUFFIX_REGEX = '#\.(yml|yaml)$#';

View File

@ -14,6 +14,7 @@ final class OnlyRuleResolver
{
/**
* @var string
* @see https://regex101.com/r/WOQuBL/1
*/
private const SLASH_REGEX = '#\\\\#';

View File

@ -21,6 +21,7 @@ final class ExcludeByDocBlockExclusionCheck implements ExclusionCheckInterface
{
/**
* @var string
* @see https://regex101.com/r/d1NMi6/1
*/
private const NO_RECTORE_ANNOTATION_WITH_CLASS_REGEX = '#\@noRector(\s)+[^\w\\\\]#i';

View File

@ -20,11 +20,13 @@ final class FilesFinder
{
/**
* @var string
* @see https://regex101.com/r/e1jm7v/1
*/
private const STARTS_WITH_ASTERISK_REGEX = '#^\*(.*?)[^*]$#';
/**
* @var string
* @see https://regex101.com/r/EgJQyZ/1
*/
private const ENDS_WITH_ASTERISK_REGEX = '#^[^*](.*?)\*$#';

View File

@ -13,6 +13,7 @@ final class ClassNodeAnalyzer
{
/**
* @var string
* @see https://regex101.com/r/FQH6RT/1
*/
private const ANONYMOUS_CLASS_REGEX = '#AnonymousClass\w+$#';

View File

@ -16,11 +16,13 @@ final class TypeAnalyzer
/**
* @var string
* @see https://regex101.com/r/fKFtfL/1
*/
private const ARRAY_TYPE_REGEX = '#array<(.*?)>#';
/**
* @var string
* @see https://regex101.com/r/57HGpC/1
*/
private const SQUARE_BRACKET_REGEX = '#(\[\])+$#';

View File

@ -16,7 +16,7 @@ final class PhpDocTagsFinder
* https://github.com/nette/di/blob/d1c0598fdecef6d3b01e2ace5f2c30214b3108e6/src/DI/Autowiring.php#L215
*
* @var string
* @link https://regex101.com/r/oEiq3y/3
* @see https://regex101.com/r/oEiq3y/3
*/
private const TAG_REGEX = '#%s[ a-zA-Z0-9_\|\\\t]+#';

View File

@ -20,6 +20,7 @@ final class NodeTransformer
{
/**
* @var string
* @see https://regex101.com/r/XFc3qA/1
*/
private const PERCENT_TEXT_REGEX = '#^%\w$#';

View File

@ -22,11 +22,13 @@ final class InlineCodeParser
{
/**
* @var string
* @see https://regex101.com/r/dwe4OW/1
*/
private const PRESLASHED_DOLLAR_REGEX = '#\\\\\$#';
/**
* @var string
* @see https://regex101.com/r/tvwhWq/1
*/
private const CURLY_BRACKET_WRAPPER_REGEX = "#'{(\\\$.*?)}'#";

View File

@ -35,21 +35,25 @@ final class BetterStandardPrinter extends Standard
{
/**
* @var string
* @see https://regex101.com/r/jUFizd/1
*/
private const NEWLINE_END_REGEX = "#\n$#";
/**
* @var string
* @see https://regex101.com/r/w5E8Rh/1
*/
private const FOUR_SPACE_START_REGEX = '#^ {4}#m';
/**
* @var string
* @see https://regex101.com/r/F5x783/1
*/
private const USE_REGEX = '#( use)\(#';
/**
* @var string
* @see https://regex101.com/r/DrsMY4/1
*/
private const QUOTED_SLASH_REGEX = "#'|\\\\(?=[\\\\']|$)#";

View File

@ -15,6 +15,7 @@ abstract class AbstractPHPUnitRector extends AbstractRector
{
/**
* @var string
* @see https://regex101.com/r/76ZfTX/1
*/
private const TEST_ANNOTATOIN_REGEX = '#@test\b#';

View File

@ -14,11 +14,13 @@ final class Skipper
{
/**
* @var string
* @see https://regex101.com/r/s7Rv0c/1
*/
private const ONLY_ENDS_WITH_ASTERISK_REGEX = '#^[^*](.*?)\*$#';
/**
* @var string
* @see https://regex101.com/r/I2z414/1
*/
private const ONLY_STARTS_WITH_ASTERISK_REGEX = '#^\*(.*?)[^*]$#';

View File

@ -13,11 +13,13 @@ final class StaticRectorStrings
{
/**
* @var string
* @see https://regex101.com/r/imzxhG/1
*/
private const UNDERSCORE_REGEX = '#_#';
/**
* @var string
* @see https://regex101.com/r/4w2of2/2
*/
private const CAMEL_CASE_SPLIT_REGEX = '#([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)#';

View File

@ -29,6 +29,7 @@ final class RectorRuleAndValueObjectHaveSameStartsRule implements Rule
/**
* @var string
* @see https://regex101.com/r/Fk6iou/1
*/
private const RECTOR_SUFFIX_REGEX = '#Rector$#';

View File

@ -11,6 +11,7 @@ final class PHPStanTypeClassFinder
{
/**
* @var string
* @see https://regex101.com/r/3PWhG9/1
*/
private const ACCESSORY_SEPARATED_REGEX = '#\bAccessory\b#';

View File

@ -15,6 +15,7 @@ final class ParallelTaskRunner
{
/**
* @var string
* @see https://regex101.com/r/WMRFCz/1
*/
private const FATAL_ERROR_REGEX = '#(Fatal error)|(\[ERROR\])#';