Skip to content

Commit

Permalink
[TASK] Do not escape @ character in regular expressions (#756)
Browse files Browse the repository at this point in the history
PhpStorm complains about it:
Warning:(65, 20) Redundant character escape '\@' in RegExp
  • Loading branch information
brotkrueml authored Mar 29, 2024
1 parent 330109b commit db4d7ad
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
66 changes: 33 additions & 33 deletions Tests/Functional/FileGenerator/Property/GeneratedPropertyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function writeModelClassWithBooleanProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var bool.*/',
'/.*\* @var bool.*/',
$classFileContent,
'var tag for boolean property was not generated'
);
Expand Down Expand Up @@ -107,7 +107,7 @@ public function writeModelClassWithColorPickerProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var string.*/',
'/.*\* @var string.*/',
$classFileContent,
'var tag for color picker property was not generated'
);
Expand Down Expand Up @@ -148,7 +148,7 @@ public function writeModelClassWithDateProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var \\\\DateTime.*/',
'/.*\* @var \\\\DateTime.*/',
$classFileContent,
'var tag for date property was not generated'
);
Expand Down Expand Up @@ -189,7 +189,7 @@ public function writeModelClassWithDateTimeProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var \\\\DateTime.*/',
'/.*\* @var \\\\DateTime.*/',
$classFileContent,
'var tag for date property was not generated'
);
Expand Down Expand Up @@ -230,7 +230,7 @@ public function writeModelClassWithEmailProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var string.*/',
'/.*\* @var string.*/',
$classFileContent,
'var tag for email property was not generated'
);
Expand Down Expand Up @@ -271,7 +271,7 @@ public function writeModelClassWithNullableEmailProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var string|null.*/',
'/.*\* @var string|null.*/',
$classFileContent,
'var tag for email property was not generated'
);
Expand Down Expand Up @@ -312,12 +312,12 @@ public function writeModelClassWithFileProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var \\\\TYPO3\\\\CMS\\\\Extbase\\\\Domain\\\\Model\\\\FileReference.*/',
'/.*\* @var \\\\TYPO3\\\\CMS\\\\Extbase\\\\Domain\\\\Model\\\\FileReference.*/',
$classFileContent,
'var tag for file property was not generated'
);
self::assertMatchesRegularExpression(
'/.*\* \@TYPO3\\\\CMS\\\\Extbase\\\\Annotation\\\\ORM\\\\Cascade\("remove"\).*/',
'/.*\* @TYPO3\\\\CMS\\\\Extbase\\\\Annotation\\\\ORM\\\\Cascade\("remove"\).*/',
$classFileContent,
'annotation for file property was not generated'
);
Expand Down Expand Up @@ -358,7 +358,7 @@ public function writeModelClassWithFloatProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var float.*/',
'/.*\* @var float.*/',
$classFileContent,
'var tag for float property was not generated'
);
Expand Down Expand Up @@ -399,7 +399,7 @@ public function writeModelClassWithNullableFloatProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var float|null.*/',
'/.*\* @var float|null.*/',
$classFileContent,
'var tag for float property was not generated'
);
Expand Down Expand Up @@ -440,12 +440,12 @@ public function writeModelClassWithImageProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var \\\\TYPO3\\\\CMS\\\\Extbase\\\\Domain\\\\Model\\\\FileReference.*/',
'/.*\* @var \\\\TYPO3\\\\CMS\\\\Extbase\\\\Domain\\\\Model\\\\FileReference.*/',
$classFileContent,
'var tag for image property was not generated'
);
self::assertMatchesRegularExpression(
'/.*\* \@TYPO3\\\\CMS\\\\Extbase\\\\Annotation\\\\ORM\\\\Cascade\("remove"\).*/',
'/.*\* @TYPO3\\\\CMS\\\\Extbase\\\\Annotation\\\\ORM\\\\Cascade\("remove"\).*/',
$classFileContent,
'annotation for image property was not generated'
);
Expand Down Expand Up @@ -486,7 +486,7 @@ public function writeModelClassWithInputLinkProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var string.*/',
'/.*\* @var string.*/',
$classFileContent,
'var tag for link property was not generated'
);
Expand Down Expand Up @@ -527,7 +527,7 @@ public function writeModelClassWithIntegerProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var int.*/',
'/.*\* @var int.*/',
$classFileContent,
'var tag for int property was not generated'
);
Expand Down Expand Up @@ -568,7 +568,7 @@ public function writeModelClassWithNullableIntegerProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var int|null.*/',
'/.*\* @var int|null.*/',
$classFileContent,
'var tag for int property was not generated'
);
Expand Down Expand Up @@ -609,7 +609,7 @@ public function writeModelClassWithNativeDateProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var \\\\DateTime.*/',
'/.*\* @var \\\\DateTime.*/',
$classFileContent,
'var tag for native date property was not generated'
);
Expand Down Expand Up @@ -650,7 +650,7 @@ public function writeModelClassWithNativeDateTimeProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var \\\\DateTime.*/',
'/.*\* @var \\\\DateTime.*/',
$classFileContent,
'var tag for native date time property was not generated'
);
Expand Down Expand Up @@ -691,7 +691,7 @@ public function writeModelClassWithNativeTimeProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var \\\\DateTime.*/',
'/.*\* @var \\\\DateTime.*/',
$classFileContent,
'var tag for native time property was not generated'
);
Expand Down Expand Up @@ -732,7 +732,7 @@ public function writeModelClassWithNoneProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var mixed.*/',
'/.*\* @var mixed.*/',
$classFileContent,
'var tag for none property was not generated'
);
Expand Down Expand Up @@ -773,7 +773,7 @@ public function writeModelClassWithPassThroughProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var mixed.*/',
'/.*\* @var mixed.*/',
$classFileContent,
'var tag for pass through property was not generated'
);
Expand Down Expand Up @@ -814,7 +814,7 @@ public function writeModelClassWithPasswordProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var string.*/',
'/.*\* @var string.*/',
$classFileContent,
'var tag for password property was not generated'
);
Expand Down Expand Up @@ -855,7 +855,7 @@ public function writeModelClassWithNullablePasswordProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var string|null.*/',
'/.*\* @var string|null.*/',
$classFileContent,
'var tag for password property was not generated'
);
Expand Down Expand Up @@ -896,7 +896,7 @@ public function writeModelClassWithRichTextProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var string.*/',
'/.*\* @var string.*/',
$classFileContent,
'var tag for rich text property was not generated'
);
Expand Down Expand Up @@ -937,7 +937,7 @@ public function writeModelClassWithSelectProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var int.*/',
'/.*\* @var int.*/',
$classFileContent,
'var tag for select property was not generated'
);
Expand Down Expand Up @@ -978,7 +978,7 @@ public function writeModelClassWithSlugProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var string.*/',
'/.*\* @var string.*/',
$classFileContent,
'var tag for slug property was not generated'
);
Expand Down Expand Up @@ -1019,7 +1019,7 @@ public function writeModelClassWithStringProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var string.*/',
'/.*\* @var string.*/',
$classFileContent,
'var tag for string property was not generated'
);
Expand Down Expand Up @@ -1060,7 +1060,7 @@ public function writeModelClassWithNullableStringProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var string|null.*/',
'/.*\* @var string|null.*/',
$classFileContent,
'var tag for string property was not generated'
);
Expand Down Expand Up @@ -1101,7 +1101,7 @@ public function writeModelClassWithTextProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var string.*/',
'/.*\* @var string.*/',
$classFileContent,
'var tag for text property was not generated'
);
Expand Down Expand Up @@ -1142,7 +1142,7 @@ public function writeModelClassWithNullableTextProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var string|null.*/',
'/.*\* @var string|null.*/',
$classFileContent,
'var tag for text property was not generated'
);
Expand Down Expand Up @@ -1183,7 +1183,7 @@ public function writeModelClassWithTimeProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var int.*/',
'/.*\* @var int.*/',
$classFileContent,
'var tag for time property was not generated'
);
Expand Down Expand Up @@ -1224,7 +1224,7 @@ public function writeModelClassWithNullableTimeProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var int|null.*/',
'/.*\* @var int|null.*/',
$classFileContent,
'var tag for time property was not generated'
);
Expand Down Expand Up @@ -1265,7 +1265,7 @@ public function writeModelClassWithTimeSecProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var int.*/',
'/.*\* @var int.*/',
$classFileContent,
'var tag for timeSec property was not generated'
);
Expand Down Expand Up @@ -1306,7 +1306,7 @@ public function writeModelClassWithNullableTimeSecProperty(): void
$classFileContent = $this->fileGenerator->generateDomainObjectCode($domainObject);

self::assertMatchesRegularExpression(
'/.*\* \@var int|null.*/',
'/.*\* @var int|null.*/',
$classFileContent,
'var tag for timeSec property was not generated'
);
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/Service/FileGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function generateCodeForModelClassWithBooleanProperty(): void
'protected boolean property was not generated'
);
self::assertMatchesRegularExpression(
'/.*\* \@var bool.*/',
'/.*\* @var bool.*/',
$classFileContent,
'var tag for boolean property was not generated'
);
Expand Down

0 comments on commit db4d7ad

Please sign in to comment.