mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-07 20:00:50 +00:00
restore regex replaces
This commit is contained in:
parent
47bea33c2e
commit
52ea41240e
|
@ -25,19 +25,19 @@ final class PHPStormVarAnnotationRector extends AbstractRector
|
|||
{
|
||||
/**
|
||||
* @var string
|
||||
* @changelog https://regex101.com/r/YY5stJ/1
|
||||
* @see https://regex101.com/r/YY5stJ/1
|
||||
*/
|
||||
private const SINGLE_ASTERISK_COMMENT_START_REGEX = '#^\/\* #';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @changelog https://regex101.com/r/meD7rP/1
|
||||
* @see https://regex101.com/r/meD7rP/1
|
||||
*/
|
||||
private const VAR_ANNOTATION_REGEX = '#\@var(\s)+\$#';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @changelog https://regex101.com/r/yz2AZ7/1
|
||||
* @see https://regex101.com/r/yz2AZ7/1
|
||||
*/
|
||||
private const VARIABLE_NAME_AND_TYPE_MATCH_REGEX = '#(?<variableName>\$\w+)(?<space>\s+)(?<type>[\\\\\w]+)#';
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ final class CatchExceptionNameMatchingTypeRector extends AbstractRector
|
|||
{
|
||||
/**
|
||||
* @var string
|
||||
* @changelog 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]*)#';
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ final class RemoveDoubleUnderscoreInMethodNameRector extends AbstractRector
|
|||
{
|
||||
/**
|
||||
* @var string
|
||||
* @changelog https://regex101.com/r/oRrhDJ/3
|
||||
* @see https://regex101.com/r/oRrhDJ/3
|
||||
*/
|
||||
private const DOUBLE_UNDERSCORE_START_REGEX = '#^__(.+)#';
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ final class ConsistentPregDelimiterRector extends AbstractRector implements Allo
|
|||
|
||||
/**
|
||||
* @var string
|
||||
* @changelog https://regex101.com/r/isdgEN/1
|
||||
* @see https://regex101.com/r/isdgEN/1
|
||||
*
|
||||
* For modifiers see https://www.php.net/manual/en/reference.pcre.pattern.modifiers.php
|
||||
*/
|
||||
|
@ -40,7 +40,7 @@ final class ConsistentPregDelimiterRector extends AbstractRector implements Allo
|
|||
|
||||
/**
|
||||
* @var string
|
||||
* @changelog https://regex101.com/r/nnuwUo/1
|
||||
* @see https://regex101.com/r/nnuwUo/1
|
||||
*
|
||||
* For modifiers see https://www.php.net/manual/en/reference.pcre.pattern.modifiers.php
|
||||
*/
|
||||
|
@ -48,13 +48,13 @@ final class ConsistentPregDelimiterRector extends AbstractRector implements Allo
|
|||
|
||||
/**
|
||||
* @var string
|
||||
* @changelog https://regex101.com/r/KpCzg6/1
|
||||
* @see https://regex101.com/r/KpCzg6/1
|
||||
*/
|
||||
private const NEW_LINE_REGEX = '#(\\r|\\n)#';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @changelog https://regex101.com/r/EyXsV6/6
|
||||
* @see https://regex101.com/r/EyXsV6/6
|
||||
*/
|
||||
private const DOUBLE_QUOTED_REGEX = '#^"(?<delimiter>.{1}).{1,}\k<delimiter>[imsxeADSUXJu]*"$#';
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ final class SymplifyQuoteEscapeRector extends AbstractRector
|
|||
{
|
||||
/**
|
||||
* @var string
|
||||
* @changelog https://regex101.com/r/qEkCe9/2
|
||||
* @see https://regex101.com/r/qEkCe9/2
|
||||
*/
|
||||
private const ESCAPED_CHAR_REGEX = '#\\\\|\$|\\n|\\t#sim';
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ final class UseClassKeywordForClassNameResolutionRector extends AbstractRector
|
|||
{
|
||||
/**
|
||||
* @var string
|
||||
* @changelog https://regex101.com/r/Vv41Qr/1/
|
||||
* @see https://regex101.com/r/Vv41Qr/1/
|
||||
*/
|
||||
private const CLASS_BEFORE_STATIC_ACCESS_REGEX = '#(?<class_name>[\\\\a-zA-Z0-9_\\x80-\\xff]*)::#';
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ final class ExceptionHandlerTypehintRector extends AbstractRector implements Min
|
|||
{
|
||||
/**
|
||||
* @var string
|
||||
* @changelog https://regex101.com/r/VBFXCR/1
|
||||
* @see https://regex101.com/r/VBFXCR/1
|
||||
*/
|
||||
private const HANDLE_INSENSITIVE_REGEX = '#handle#i';
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ final class RegexDashEscapeRector extends AbstractRector implements MinPhpVersio
|
|||
{
|
||||
/**
|
||||
* @var string
|
||||
* @changelog https://regex101.com/r/iQbGgZ/1
|
||||
* @see https://regex101.com/r/iQbGgZ/1
|
||||
*
|
||||
* Use {2} as detected only 2 after $this->regexPatternArgumentManipulator->matchCallArgumentWithRegexPattern() call
|
||||
*/
|
||||
|
@ -34,13 +34,13 @@ final class RegexDashEscapeRector extends AbstractRector implements MinPhpVersio
|
|||
|
||||
/**
|
||||
* @var string
|
||||
* @changelog https://regex101.com/r/YgVJFp/1
|
||||
* @see https://regex101.com/r/YgVJFp/1
|
||||
*/
|
||||
private const LEFT_HAND_UNESCAPED_DASH_REGEX = '#(\[.*?\\\\(w|s|d))-(?!\])#i';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @changelog https://regex101.com/r/TBVme9/8
|
||||
* @see https://regex101.com/r/TBVme9/8
|
||||
*/
|
||||
private const RIGHT_HAND_UNESCAPED_DASH_REGEX = '#(?<!\[)-(\\\\(w|s|d)[.*]?)\]#i';
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ final class RepeatedLiteralToClassConstantRector extends AbstractRector
|
|||
|
||||
/**
|
||||
* @var string
|
||||
* @changelog https://regex101.com/r/osJLMF/1
|
||||
* @see https://regex101.com/r/osJLMF/1
|
||||
*/
|
||||
private const SLASH_AND_DASH_REGEX = '#[-\\\/]#';
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ use Webmozart\Assert\Assert;
|
|||
final class PseudoNamespaceToNamespaceRector extends AbstractRector implements ConfigurableRectorInterface
|
||||
{
|
||||
/**
|
||||
* @changelog https://regex101.com/r/chvLgs/1/
|
||||
* @see https://regex101.com/r/chvLgs/1/
|
||||
* @var string
|
||||
*/
|
||||
private const SPLIT_BY_UNDERSCORE_REGEX = '#([a-zA-Z])(_)?(_)([a-zA-Z])#';
|
||||
|
|
|
@ -29,7 +29,7 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
|||
final class ArrayShapeFromConstantArrayReturnRector extends AbstractRector
|
||||
{
|
||||
/**
|
||||
* @changelog https://regex101.com/r/WvUD0m/2
|
||||
* @see https://regex101.com/r/WvUD0m/2
|
||||
* @var string
|
||||
*/
|
||||
private const SKIPPED_CHAR_REGEX = '#\W#u';
|
||||
|
|
|
@ -17,14 +17,14 @@ use Webmozart\Assert\Assert;
|
|||
final class RenameClassNonPhpRector implements NonPhpRectorInterface, ConfigurableRuleInterface, ConfigurableRectorInterface, ComplementaryRectorInterface
|
||||
{
|
||||
/**
|
||||
* @changelog https://regex101.com/r/HKUFJD/7
|
||||
* @see https://regex101.com/r/HKUFJD/7
|
||||
* for "?<!" @see https://stackoverflow.com/a/3735908/1348344
|
||||
* @var string
|
||||
*/
|
||||
private const STANDALONE_CLASS_PREFIX_REGEX = '#((?<!(\\\\|"|\>|\.|\'))|(?<extra_space>\s+\\\\))';
|
||||
|
||||
/**
|
||||
* @changelog https://regex101.com/r/HKUFJD/5
|
||||
* @see https://regex101.com/r/HKUFJD/5
|
||||
* @changelog https://stackoverflow.com/a/3926546/1348344
|
||||
* @var string
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user