From 0158a4f8b8df431ba87db6c413ec1b94da5881c6 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Thu, 14 Dec 2023 12:23:54 +0100 Subject: [PATCH 1/2] Update InflectorSingularResolver.php --- rules/Naming/ExpectedNameResolver/InflectorSingularResolver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/Naming/ExpectedNameResolver/InflectorSingularResolver.php b/rules/Naming/ExpectedNameResolver/InflectorSingularResolver.php index 2ff536c666e..940f23a9008 100644 --- a/rules/Naming/ExpectedNameResolver/InflectorSingularResolver.php +++ b/rules/Naming/ExpectedNameResolver/InflectorSingularResolver.php @@ -95,7 +95,7 @@ private function singularizeCamelParts(string $currentName): string $resolvedName = ''; foreach ($camelCases as $camelCase) { - if (in_array($camelCase[self::CAMELCASE], ['is', 'has', 'cms'], true)) { + if (in_array($camelCase[self::CAMELCASE], ['is', 'has', 'cms', 'this'], true)) { $value = $camelCase[self::CAMELCASE]; } else { $value = $this->inflector->singularize($camelCase[self::CAMELCASE]); From e03159214340da98c68fdc71a4ffef5e747ad6df Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Fri, 15 Dec 2023 03:08:51 +0100 Subject: [PATCH 2/2] Added test --- .../Fixture/skip_this.php.inc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 rules-tests/Naming/Rector/Foreach_/RenameForeachValueVariableToMatchExprVariableRector/Fixture/skip_this.php.inc diff --git a/rules-tests/Naming/Rector/Foreach_/RenameForeachValueVariableToMatchExprVariableRector/Fixture/skip_this.php.inc b/rules-tests/Naming/Rector/Foreach_/RenameForeachValueVariableToMatchExprVariableRector/Fixture/skip_this.php.inc new file mode 100644 index 00000000000..c3d5b395440 --- /dev/null +++ b/rules-tests/Naming/Rector/Foreach_/RenameForeachValueVariableToMatchExprVariableRector/Fixture/skip_this.php.inc @@ -0,0 +1,14 @@ +