From 54b95e0501955cfc715839bd2062dff0e4494421 Mon Sep 17 00:00:00 2001 From: Antoine Bluchet Date: Tue, 19 Mar 2024 08:17:04 +0100 Subject: [PATCH] Revert "fix: class_exists calls without argument (#6227)" This reverts commit be8c03f4cef93f60817d5be2a4ab33aa3446716e. --- src/Api/Entrypoint.php | 2 +- src/Api/QueryParameterValidator/Validator/Enum.php | 2 +- src/Api/QueryParameterValidator/Validator/Length.php | 2 +- src/Api/QueryParameterValidator/Validator/MultipleOf.php | 2 +- src/Api/QueryParameterValidator/Validator/Pattern.php | 2 +- src/Api/QueryParameterValidator/Validator/Required.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Api/Entrypoint.php b/src/Api/Entrypoint.php index f337f451b30..984a5c5e876 100644 --- a/src/Api/Entrypoint.php +++ b/src/Api/Entrypoint.php @@ -35,6 +35,6 @@ public function getResourceNameCollection(): ResourceNameCollection } } -if (!class_exists(\ApiPlatform\Core\Api\Entrypoint::class)) { +if (!class_exists()) { class_alias(Entrypoint::class, \ApiPlatform\Core\Api\Entrypoint::class); } diff --git a/src/Api/QueryParameterValidator/Validator/Enum.php b/src/Api/QueryParameterValidator/Validator/Enum.php index 093ec2b52e0..5e6ccb9013e 100644 --- a/src/Api/QueryParameterValidator/Validator/Enum.php +++ b/src/Api/QueryParameterValidator/Validator/Enum.php @@ -34,6 +34,6 @@ public function validate(string $name, array $filterDescription, array $queryPar } } -if (!class_exists(\ApiPlatform\Core\Filter\Validator\Enum::class)) { +if (!class_exists()) { class_alias(Enum::class, \ApiPlatform\Core\Filter\Validator\Enum::class); } diff --git a/src/Api/QueryParameterValidator/Validator/Length.php b/src/Api/QueryParameterValidator/Validator/Length.php index 8aa34ed8d09..05f4d490f91 100644 --- a/src/Api/QueryParameterValidator/Validator/Length.php +++ b/src/Api/QueryParameterValidator/Validator/Length.php @@ -39,6 +39,6 @@ public function validate(string $name, array $filterDescription, array $queryPar } } -if (!class_exists(\ApiPlatform\Core\Filter\Validator\Length::class)) { +if (!class_exists()) { class_alias(Length::class, \ApiPlatform\Core\Filter\Validator\Length::class); } diff --git a/src/Api/QueryParameterValidator/Validator/MultipleOf.php b/src/Api/QueryParameterValidator/Validator/MultipleOf.php index 7fc2ce40b79..dc9653f5a03 100644 --- a/src/Api/QueryParameterValidator/Validator/MultipleOf.php +++ b/src/Api/QueryParameterValidator/Validator/MultipleOf.php @@ -34,6 +34,6 @@ public function validate(string $name, array $filterDescription, array $queryPar } } -if (!class_exists(\ApiPlatform\Core\Filter\Validator\MultipleOf::class)) { +if (!class_exists()) { class_alias(MultipleOf::class, \ApiPlatform\Core\Filter\Validator\MultipleOf::class); } diff --git a/src/Api/QueryParameterValidator/Validator/Pattern.php b/src/Api/QueryParameterValidator/Validator/Pattern.php index 4ba0bfa56d5..236412c3245 100644 --- a/src/Api/QueryParameterValidator/Validator/Pattern.php +++ b/src/Api/QueryParameterValidator/Validator/Pattern.php @@ -34,6 +34,6 @@ public function validate(string $name, array $filterDescription, array $queryPar } } -if (!class_exists(\ApiPlatform\Core\Filter\Validator\Pattern::class)) { +if (!class_exists()) { class_alias(Pattern::class, \ApiPlatform\Core\Filter\Validator\Pattern::class); } diff --git a/src/Api/QueryParameterValidator/Validator/Required.php b/src/Api/QueryParameterValidator/Validator/Required.php index b0b5899e6f0..251fd49a035 100644 --- a/src/Api/QueryParameterValidator/Validator/Required.php +++ b/src/Api/QueryParameterValidator/Validator/Required.php @@ -98,6 +98,6 @@ private function requestGetQueryParameter(array $queryParameters, string $name) } } -if (!class_exists(\ApiPlatform\Core\Filter\Validator\Required::class)) { +if (!class_exists()) { class_alias(Required::class, \ApiPlatform\Core\Filter\Validator\Required::class); }