Skip to content

Commit

Permalink
restore regex replaces
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed May 12, 2022
1 parent 47bea33 commit 52ea412
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]+)#';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]*)#';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '#^__(.+)#';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,29 @@ 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
*/
private const INNER_REGEX = '#(?<content>.*?)(?<close>[imsxeADSUXJu]*)$#s';

/**
* @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
*/
private const INNER_UNICODE_REGEX = '#(?<content>.*?)(?<close>[imsxeADSUXJu]*)$#u';

/**
* @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]*"$#';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]*)::#';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
6 changes: 3 additions & 3 deletions rules/Php73/Rector/FuncCall/RegexDashEscapeRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ 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
*/
private const THREE_BACKSLASH_FOR_ESCAPE_NEXT_REGEX = '#(?<=[^\\\\])\\\\{2}(?=[^\\\\])#';

/**
* @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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '#[-\\\/]#';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
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])#';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
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';
Expand Down
4 changes: 2 additions & 2 deletions src/NonPhpFile/Rector/RenameClassNonPhpRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
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
*/
Expand Down

0 comments on commit 52ea412

Please sign in to comment.