From 0d3c4a6441bb4799b883001de37ffc24f8926b15 Mon Sep 17 00:00:00 2001 From: Martin Georgiev Date: Thu, 23 Oct 2025 16:09:32 +0100 Subject: [PATCH] feat!: remove deprecations scheduled for v4.0 --- .../ORM/Query/AST/Functions/BaseFunction.php | 18 +---------- .../Query/AST/Functions/FlaggedRegexpLike.php | 26 --------------- .../AST/Functions/FlaggedRegexpMatch.php | 26 --------------- .../AST/Functions/FlaggedRegexpReplace.php | 26 --------------- .../AST/Functions/FlaggedRegexpLikeTest.php | 32 ------------------- .../AST/Functions/FlaggedRegexpMatchTest.php | 32 ------------------- .../Functions/FlaggedRegexpReplaceTest.php | 32 ------------------- 7 files changed, 1 insertion(+), 191 deletions(-) delete mode 100644 src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpLike.php delete mode 100644 src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpMatch.php delete mode 100644 src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpReplace.php delete mode 100644 tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpLikeTest.php delete mode 100644 tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpMatchTest.php delete mode 100644 tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpReplaceTest.php diff --git a/src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunction.php b/src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunction.php index ca045e36..67ca929e 100644 --- a/src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunction.php +++ b/src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunction.php @@ -33,26 +33,10 @@ abstract class BaseFunction extends FunctionNode /** * This method is meant for internal use only, and it is not suggested that the forks of the library depend on it. - * It will be made abstract from version 3.0. * * @internal - * - * @see customiseFunction() */ - /* abstract */ - protected function customizeFunction(): void - { - // Void - } - - /** - * @deprecated - */ - protected function customiseFunction(): void - { - \trigger_error('The internal-use method of `customiseFunction()` is deprecated and is now renamed to `customizeFunction()`. `customiseFunction()` will be removed from version 3.0 onwards.', E_USER_DEPRECATED); - $this->customizeFunction(); - } + abstract protected function customizeFunction(): void; protected function setFunctionPrototype(string $functionPrototype): void { diff --git a/src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpLike.php b/src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpLike.php deleted file mode 100644 index 65b8b793..00000000 --- a/src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpLike.php +++ /dev/null @@ -1,26 +0,0 @@ - - */ -class FlaggedRegexpLike extends BaseFunction -{ - protected function customizeFunction(): void - { - $this->setFunctionPrototype('regexp_like(%s, %s, %s)'); - $this->addNodeMapping('StringPrimary'); - $this->addNodeMapping('StringPrimary'); - $this->addNodeMapping('StringPrimary'); - } -} diff --git a/src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpMatch.php b/src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpMatch.php deleted file mode 100644 index 27c49ad7..00000000 --- a/src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpMatch.php +++ /dev/null @@ -1,26 +0,0 @@ - - */ -class FlaggedRegexpMatch extends BaseFunction -{ - protected function customizeFunction(): void - { - $this->setFunctionPrototype('regexp_match(%s, %s, %s)'); - $this->addNodeMapping('StringPrimary'); - $this->addNodeMapping('StringPrimary'); - $this->addNodeMapping('StringPrimary'); - } -} diff --git a/src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpReplace.php b/src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpReplace.php deleted file mode 100644 index d79edc9f..00000000 --- a/src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpReplace.php +++ /dev/null @@ -1,26 +0,0 @@ -setFunctionPrototype('regexp_replace(%s, %s, %s, %s)'); - $this->addNodeMapping('StringPrimary'); - $this->addNodeMapping('StringPrimary'); - $this->addNodeMapping('StringPrimary'); - $this->addNodeMapping('StringPrimary'); - } -} diff --git a/tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpLikeTest.php b/tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpLikeTest.php deleted file mode 100644 index 7b28b95c..00000000 --- a/tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpLikeTest.php +++ /dev/null @@ -1,32 +0,0 @@ - FlaggedRegexpLike::class, // @phpstan-ignore-line - ]; - } - - protected function getExpectedSqlStatements(): array - { - return [ - 'checks if text matches regex pattern with flags' => "SELECT regexp_like(c0_.text1, 'pattern', 'i') AS sclr_0 FROM ContainsTexts c0_", - ]; - } - - protected function getDqlStatements(): array - { - return [ - 'checks if text matches regex pattern with flags' => \sprintf("SELECT FLAGGED_REGEXP_LIKE(e.text1, 'pattern', 'i') FROM %s e", ContainsTexts::class), - ]; - } -} diff --git a/tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpMatchTest.php b/tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpMatchTest.php deleted file mode 100644 index bc914fde..00000000 --- a/tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpMatchTest.php +++ /dev/null @@ -1,32 +0,0 @@ - FlaggedRegexpMatch::class, // @phpstan-ignore-line - ]; - } - - protected function getExpectedSqlStatements(): array - { - return [ - 'matches text using regex with flags' => "SELECT regexp_match(c0_.text1, 'pattern', 'i') AS sclr_0 FROM ContainsTexts c0_", - ]; - } - - protected function getDqlStatements(): array - { - return [ - 'matches text using regex with flags' => \sprintf("SELECT FLAGGED_REGEXP_MATCH(e.text1, 'pattern', 'i') FROM %s e", ContainsTexts::class), - ]; - } -} diff --git a/tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpReplaceTest.php b/tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpReplaceTest.php deleted file mode 100644 index 519fd50b..00000000 --- a/tests/Unit/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/FlaggedRegexpReplaceTest.php +++ /dev/null @@ -1,32 +0,0 @@ - FlaggedRegexpReplace::class, // @phpstan-ignore-line - ]; - } - - protected function getExpectedSqlStatements(): array - { - return [ - 'replaces text using regex with flags' => "SELECT regexp_replace(c0_.text1, 'pattern', 'replacement', 'g') AS sclr_0 FROM ContainsTexts c0_", - ]; - } - - protected function getDqlStatements(): array - { - return [ - 'replaces text using regex with flags' => \sprintf("SELECT FLAGGED_REGEXP_REPLACE(e.text1, 'pattern', 'replacement', 'g') FROM %s e", ContainsTexts::class), - ]; - } -}