From 4b14fe01a92dfdbd55eb71d63086760faed4ba33 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Oct 2023 15:39:21 +0200 Subject: [PATCH] Fix missleading deprecated phpdoc attributes --- src/Accessable.php | 10 ++++------ src/Exception/AccessException.php | 2 +- src/Exception/Exception.php | 6 +++--- src/Exception/FactoryException.php | 2 +- src/Exception/InputException.php | 2 +- src/Exception/ValidationException.php | 2 +- src/Factory.php | 5 ++--- src/Input/Input.php | 5 ++--- src/Manager.php | 11 ++++------- src/Serializer/Serializer.php | 4 ++-- 10 files changed, 21 insertions(+), 28 deletions(-) diff --git a/src/Accessable.php b/src/Accessable.php index cf63145..8df8d91 100644 --- a/src/Accessable.php +++ b/src/Accessable.php @@ -27,22 +27,20 @@ public function get($key); /** * Check if a value exists * - * @deprecated `\Art4\JsonApiClient\Accessable::has()` will add `bool` as a native return type declaration in v2.0. Do the same in your implementation now to avoid errors. + * @return-type-will-change bool `\Art4\JsonApiClient\Accessable::has()` will add `bool` as a native return type declaration in v2.0. Do the same in your implementation now to avoid errors. * * @param mixed $key The key * * @return bool */ - public function has($key); - // public function has($key): bool; + public function has($key)/*: bool */; /** * Returns the keys of all setted values * - * @deprecated `\Art4\JsonApiClient\Accessable::getKeys()` will add `array` as a native return type declaration in v2.0. Do the same in your implementation now to avoid errors. + * @return-type-will-change array `\Art4\JsonApiClient\Accessable::getKeys()` will add `array` as a native return type declaration in v2.0. Do the same in your implementation now to avoid errors. * * @return array Keys of all setted values */ - public function getKeys(); - // public function getKeys(): array; + public function getKeys()/*: array */; } diff --git a/src/Exception/AccessException.php b/src/Exception/AccessException.php index 9edf22e..ee57d2e 100644 --- a/src/Exception/AccessException.php +++ b/src/Exception/AccessException.php @@ -8,4 +8,4 @@ namespace Art4\JsonApiClient\Exception; -class AccessException extends \RuntimeException implements Exception, \Throwable {} +class AccessException extends \RuntimeException implements Exception {} diff --git a/src/Exception/Exception.php b/src/Exception/Exception.php index 0e88f54..87f6be5 100644 --- a/src/Exception/Exception.php +++ b/src/Exception/Exception.php @@ -9,7 +9,7 @@ namespace Art4\JsonApiClient\Exception; /** - * @deprecated `\Art4\JsonApiClient\Exception\Exception` will extend `\Throwable` in v2.0. Do the same in your implementation now to avoid errors. + * Please note: `\Art4\JsonApiClient\Exception\Exception` will extend `\Throwable` in v2.0. Do the same in your implementation now to avoid errors. */ -// interface Exception extends \Throwable -interface Exception {} +interface Exception /*extends \Throwable */ +{} diff --git a/src/Exception/FactoryException.php b/src/Exception/FactoryException.php index 3b8ffbb..be7cb9c 100644 --- a/src/Exception/FactoryException.php +++ b/src/Exception/FactoryException.php @@ -8,4 +8,4 @@ namespace Art4\JsonApiClient\Exception; -class FactoryException extends \Exception implements Exception, \Throwable {} +class FactoryException extends \Exception implements Exception {} diff --git a/src/Exception/InputException.php b/src/Exception/InputException.php index b59fe12..5ec8cc6 100644 --- a/src/Exception/InputException.php +++ b/src/Exception/InputException.php @@ -8,4 +8,4 @@ namespace Art4\JsonApiClient\Exception; -class InputException extends \Exception implements Exception, \Throwable {} +class InputException extends \Exception implements Exception {} diff --git a/src/Exception/ValidationException.php b/src/Exception/ValidationException.php index 771e20a..4273774 100644 --- a/src/Exception/ValidationException.php +++ b/src/Exception/ValidationException.php @@ -8,4 +8,4 @@ namespace Art4\JsonApiClient\Exception; -class ValidationException extends \InvalidArgumentException implements Exception, \Throwable {} +class ValidationException extends \InvalidArgumentException implements Exception {} diff --git a/src/Factory.php b/src/Factory.php index 5d7ab7b..c3fa021 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -16,12 +16,11 @@ interface Factory /** * Create a new instance of a class * - * @deprecated `\Art4\JsonApiClient\Factory::make()` will add `\Art4\JsonApiClient\Accessable` as a native return type declaration in v2.0. Do the same in your implementation now to avoid errors. + * @return-type-will-change Accessable `\Art4\JsonApiClient\Factory::make()` will add `\Art4\JsonApiClient\Accessable` as a native return type declaration in v2.0. Do the same in your implementation now to avoid errors. * * @param array $args * * @return \Art4\JsonApiClient\Accessable */ - public function make(string $name, array $args = []); - // public function make(string $name, array $args = []): Accessable; + public function make(string $name, array $args = [])/*: Accessable */; } diff --git a/src/Input/Input.php b/src/Input/Input.php index 457a534..163b53a 100644 --- a/src/Input/Input.php +++ b/src/Input/Input.php @@ -16,7 +16,7 @@ interface Input /** * Get the input as simple object * - * @deprecated `\Art4\JsonApiClient\Input\Input::getAsObject()` will add `\stdClass` as a native return type declaration in v2.0. Do the same in your implementation now to avoid errors. + * @return-type-will-change \stdClass `\Art4\JsonApiClient\Input\Input::getAsObject()` will add `\stdClass` as a native return type declaration in v2.0. Do the same in your implementation now to avoid errors. * * This should be a native PHP stdClass object, so Manager could * iterate over all public attributes @@ -25,6 +25,5 @@ interface Input * * @return \stdClass */ - public function getAsObject(); - // public function getAsObject(): \stdClass; + public function getAsObject()/*: \stdClass */; } diff --git a/src/Manager.php b/src/Manager.php index eba6d26..b9df215 100644 --- a/src/Manager.php +++ b/src/Manager.php @@ -18,25 +18,23 @@ interface Manager /** * Parse the input * - * @deprecated `\Art4\JsonApiClient\Manager::parse()` will add `\Art4\JsonApiClient\Accessable` as a native return type declaration in v2.0. Do the same in your implementation now to avoid errors. + * @return-type-will-change Accessable `\Art4\JsonApiClient\Manager::parse()` will add `\Art4\JsonApiClient\Accessable` as a native return type declaration in v2.0. Do the same in your implementation now to avoid errors. * * @throws \Art4\JsonApiClient\Exception\InputException If $input contains invalid JSON API * @throws \Art4\JsonApiClient\Exception\ValidationException If $input contains invalid JSON API * * @return \Art4\JsonApiClient\Accessable */ - public function parse(Input $input); - // public function parse(Input $input): Accessable; + public function parse(Input $input)/*: Accessable */; /** * Get a factory from the manager * - * @deprecated `\Art4\JsonApiClient\Manager::getFactory()` will add `\Art4\JsonApiClient\Factory` as a native return type declaration in v2.0. Do the same in your implementation now to avoid errors. + * @return-type-will-change Factory `\Art4\JsonApiClient\Manager::getFactory()` will add `\Art4\JsonApiClient\Factory` as a native return type declaration in v2.0. Do the same in your implementation now to avoid errors. * * @return \Art4\JsonApiClient\Factory */ - public function getFactory(); - // public function getFactory(): Factory; + public function getFactory()/*: Factory */; /** * Get a param by key @@ -46,5 +44,4 @@ public function getFactory(); * @return mixed */ public function getParam(string $key, $default); - // public function getParam(string $key, $default); } diff --git a/src/Serializer/Serializer.php b/src/Serializer/Serializer.php index 823ebe1..f6a4324 100644 --- a/src/Serializer/Serializer.php +++ b/src/Serializer/Serializer.php @@ -15,9 +15,9 @@ interface Serializer /** * Serialize data * - * @deprecated `\Art4\JsonApiClient\Serializer\Serializer::serialize()` will add `?array` as a native return type declaration in v2.0. Do the same in your implementation now to avoid errors. + * @return-type-will-change ?array `\Art4\JsonApiClient\Serializer\Serializer::serialize()` will add `?array` as a native return type declaration in v2.0. Do the same in your implementation now to avoid errors. * * @return array|null */ - public function serialize(Accessable $data); + public function serialize(Accessable $data)/*: ?array */; }