Skip to content

Commit 94aaa3c

Browse files
committed
[deprecated] Drop regex rules, as too nitpicking, in times of GPT pointless
1 parent 2eacb49 commit 94aaa3c

23 files changed

+1
-781
lines changed

README.md

Lines changed: 1 addition & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -61,39 +61,7 @@ services:
6161
6262
<br>
6363
64-
# 30 Rules Overview
65-
66-
## AnnotateRegexClassConstWithRegexLinkRule
67-
68-
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
69-
70-
```yaml
71-
rules:
72-
- Symplify\PHPStanRules\Rules\AnnotateRegexClassConstWithRegexLinkRule
73-
```
74-
75-
```php
76-
class SomeClass
77-
{
78-
private const COMPLICATED_REGEX = '#some_complicated_stu|ff#';
79-
}
80-
```
81-
82-
:x:
83-
84-
<br>
85-
86-
```php
87-
class SomeClass
88-
{
89-
/**
90-
* @see https://regex101.com/r/SZr0X5/12
91-
*/
92-
private const COMPLICATED_REGEX = '#some_complicated_stu|ff#';
93-
}
94-
```
95-
96-
:+1:
64+
# 25+ Rules Overview
9765
9866
<br>
9967
@@ -562,48 +530,6 @@ class SomeClass
562530

563531
<br>
564532

565-
## NoInlineStringRegexRule
566-
567-
Use local named constant instead of inline string for regex to explain meaning by constant name
568-
569-
```yaml
570-
rules:
571-
- Symplify\PHPStanRules\Rules\NoInlineStringRegexRule
572-
```
573-
574-
```php
575-
class SomeClass
576-
{
577-
public function run($value)
578-
{
579-
return preg_match('#some_stu|ff#', $value);
580-
}
581-
}
582-
```
583-
584-
:x:
585-
586-
<br>
587-
588-
```php
589-
class SomeClass
590-
{
591-
/**
592-
* @var string
593-
*/
594-
public const SOME_STUFF_REGEX = '#some_stu|ff#';
595-
596-
public function run($value)
597-
{
598-
return preg_match(self::SOME_STUFF_REGEX, $value);
599-
}
600-
}
601-
```
602-
603-
:+1:
604-
605-
<br>
606-
607533
## NoReferenceRule
608534

609535
Use explicit return value over magic &reference
@@ -895,47 +821,6 @@ class SomeClass extends SomeParentClass
895821

896822
<br>
897823

898-
## RegexSuffixInRegexConstantRule
899-
900-
Name your constant with "_REGEX" suffix, instead of "%s"
901-
902-
```yaml
903-
rules:
904-
- Symplify\PHPStanRules\Rules\RegexSuffixInRegexConstantRule
905-
```
906-
907-
```php
908-
class SomeClass
909-
{
910-
public const SOME_NAME = '#some\s+name#';
911-
912-
public function run($value)
913-
{
914-
$somePath = preg_match(self::SOME_NAME, $value);
915-
}
916-
}
917-
```
918-
919-
:x:
920-
921-
<br>
922-
923-
```php
924-
class SomeClass
925-
{
926-
public const SOME_NAME_REGEX = '#some\s+name#';
927-
928-
public function run($value)
929-
{
930-
$somePath = preg_match(self::SOME_NAME_REGEX, $value);
931-
}
932-
}
933-
```
934-
935-
:+1:
936-
937-
<br>
938-
939824
## RequireAttributeNameRule
940825

941826
Attribute must have all names explicitly defined

config/regex-rules.neon

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/Rules/AnnotateRegexClassConstWithRegexLinkRule.php

Lines changed: 0 additions & 112 deletions
This file was deleted.

src/Rules/NoInlineStringRegexRule.php

Lines changed: 0 additions & 106 deletions
This file was deleted.

0 commit comments

Comments
 (0)