Skip to content

Commit 4b14fe0

Browse files
committed
Fix missleading deprecated phpdoc attributes
1 parent 7790b3b commit 4b14fe0

File tree

10 files changed

+21
-28
lines changed

10 files changed

+21
-28
lines changed

src/Accessable.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,20 @@ public function get($key);
2727
/**
2828
* Check if a value exists
2929
*
30-
* @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.
30+
* @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.
3131
*
3232
* @param mixed $key The key
3333
*
3434
* @return bool
3535
*/
36-
public function has($key);
37-
// public function has($key): bool;
36+
public function has($key)/*: bool */;
3837

3938
/**
4039
* Returns the keys of all setted values
4140
*
42-
* @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.
41+
* @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.
4342
*
4443
* @return array<string|int> Keys of all setted values
4544
*/
46-
public function getKeys();
47-
// public function getKeys(): array;
45+
public function getKeys()/*: array */;
4846
}

src/Exception/AccessException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
namespace Art4\JsonApiClient\Exception;
1010

11-
class AccessException extends \RuntimeException implements Exception, \Throwable {}
11+
class AccessException extends \RuntimeException implements Exception {}

src/Exception/Exception.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace Art4\JsonApiClient\Exception;
1010

1111
/**
12-
* @deprecated `\Art4\JsonApiClient\Exception\Exception` will extend `\Throwable` in v2.0. Do the same in your implementation now to avoid errors.
12+
* Please note: `\Art4\JsonApiClient\Exception\Exception` will extend `\Throwable` in v2.0. Do the same in your implementation now to avoid errors.
1313
*/
14-
// interface Exception extends \Throwable
15-
interface Exception {}
14+
interface Exception /*extends \Throwable */
15+
{}

src/Exception/FactoryException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
namespace Art4\JsonApiClient\Exception;
1010

11-
class FactoryException extends \Exception implements Exception, \Throwable {}
11+
class FactoryException extends \Exception implements Exception {}

src/Exception/InputException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
namespace Art4\JsonApiClient\Exception;
1010

11-
class InputException extends \Exception implements Exception, \Throwable {}
11+
class InputException extends \Exception implements Exception {}

src/Exception/ValidationException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
namespace Art4\JsonApiClient\Exception;
1010

11-
class ValidationException extends \InvalidArgumentException implements Exception, \Throwable {}
11+
class ValidationException extends \InvalidArgumentException implements Exception {}

src/Factory.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ interface Factory
1616
/**
1717
* Create a new instance of a class
1818
*
19-
* @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.
19+
* @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.
2020
*
2121
* @param array<mixed|Manager|Accessable> $args
2222
*
2323
* @return \Art4\JsonApiClient\Accessable
2424
*/
25-
public function make(string $name, array $args = []);
26-
// public function make(string $name, array $args = []): Accessable;
25+
public function make(string $name, array $args = [])/*: Accessable */;
2726
}

src/Input/Input.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface Input
1616
/**
1717
* Get the input as simple object
1818
*
19-
* @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.
19+
* @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.
2020
*
2121
* This should be a native PHP stdClass object, so Manager could
2222
* iterate over all public attributes
@@ -25,6 +25,5 @@ interface Input
2525
*
2626
* @return \stdClass
2727
*/
28-
public function getAsObject();
29-
// public function getAsObject(): \stdClass;
28+
public function getAsObject()/*: \stdClass */;
3029
}

src/Manager.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,23 @@ interface Manager
1818
/**
1919
* Parse the input
2020
*
21-
* @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.
21+
* @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.
2222
*
2323
* @throws \Art4\JsonApiClient\Exception\InputException If $input contains invalid JSON API
2424
* @throws \Art4\JsonApiClient\Exception\ValidationException If $input contains invalid JSON API
2525
*
2626
* @return \Art4\JsonApiClient\Accessable
2727
*/
28-
public function parse(Input $input);
29-
// public function parse(Input $input): Accessable;
28+
public function parse(Input $input)/*: Accessable */;
3029

3130
/**
3231
* Get a factory from the manager
3332
*
34-
* @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.
33+
* @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.
3534
*
3635
* @return \Art4\JsonApiClient\Factory
3736
*/
38-
public function getFactory();
39-
// public function getFactory(): Factory;
37+
public function getFactory()/*: Factory */;
4038

4139
/**
4240
* Get a param by key
@@ -46,5 +44,4 @@ public function getFactory();
4644
* @return mixed
4745
*/
4846
public function getParam(string $key, $default);
49-
// public function getParam(string $key, $default);
5047
}

src/Serializer/Serializer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ interface Serializer
1515
/**
1616
* Serialize data
1717
*
18-
* @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.
18+
* @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.
1919
*
2020
* @return array<string, mixed>|null
2121
*/
22-
public function serialize(Accessable $data);
22+
public function serialize(Accessable $data)/*: ?array */;
2323
}

0 commit comments

Comments
 (0)