From 9b45b3ed4d46a4bfc7a6d2d1eaa5faa16c1e3b29 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 17 Nov 2026 16:54:21 +0100 Subject: [PATCH] [CodeQuality] Remove deprecated SuffixMockObjectPropertyRector --- .../Class_/SuffixMockObjectPropertyRector.php | 89 ------------------- 1 file changed, 89 deletions(-) delete mode 100644 rules/CodeQuality/Rector/Class_/SuffixMockObjectPropertyRector.php diff --git a/rules/CodeQuality/Rector/Class_/SuffixMockObjectPropertyRector.php b/rules/CodeQuality/Rector/Class_/SuffixMockObjectPropertyRector.php deleted file mode 100644 index 56ecbe8f..00000000 --- a/rules/CodeQuality/Rector/Class_/SuffixMockObjectPropertyRector.php +++ /dev/null @@ -1,89 +0,0 @@ -simpleObject = $this->createMock(SimpleObject::class); - } - - public function test() - { - $this->simpleObject->method('someMethod')->willReturn('someValue'); - } -} -CODE_SAMPLE - , - <<<'CODE_SAMPLE' -use PHPUnit\Framework\TestCase; -use PHPUnit\Framework\MockObject\MockObject; - -final class MockingEntity extends TestCase -{ - private MockObject $simpleObjectMock; - - protected function setUp(): void - { - $this->simpleObjectMock = $this->createMock(SimpleObject::class); - } - - public function test() - { - $this->simpleObjectMock->method('someMethod')->willReturn('someValue'); - } -} -CODE_SAMPLE - ), - ] - ); - } - - /** - * @return array> - */ - public function getNodeTypes(): array - { - return [Class_::class]; - } - - /** - * @param Class_ $node - */ - public function refactor(Node $node): ?Node - { - throw new ShouldNotHappenException(sprintf( - '"%s" is deprecated, as renaming properties can produce invalid variable names. Use a coding standard to enforce the "Mock" suffix instead.', - self::class, - )); - } -}