Skip to content

Commit fc94db0

Browse files
authored
chore: missing deprecations (#6480)
1 parent 1033064 commit fc94db0

File tree

78 files changed

+688
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+688
-68
lines changed

src/Action/NotExposedAction.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
/**
2020
* An action which always returns HTTP 404 Not Found with an explanation for why the operation is not exposed.
21+
*
22+
* @deprecated use ApiPlatform\Symfony\Action\NotExposedAction
2123
*/
2224
final class NotExposedAction
2325
{

src/Action/NotFoundAction.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
/**
1919
* An action which always returns HTTP 404 Not Found. Useful for disabling an operation.
20+
*
21+
* @deprecated use ApiPlatform\Symfony\Action\NotFoundAction
2022
*/
2123
final class NotFoundAction
2224
{

src/Action/PlaceholderAction.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* Placeholder returning the data passed in parameter.
1818
*
1919
* @author Kévin Dunglas <[email protected]>
20+
*
21+
* @deprecated use ApiPlatform\Symfony\Action\PlaceholderAction
2022
*/
2123
final class PlaceholderAction
2224
{

src/Elasticsearch/Metadata/Resource/Factory/ElasticsearchProviderResourceMetadataCollectionFactory.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,17 @@
2121
use ApiPlatform\Metadata\Operation;
2222
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
2323
use ApiPlatform\Metadata\Resource\ResourceMetadataCollection;
24-
use ApiPlatform\Metadata\Util\Inflector;
2524
use Elasticsearch\Client;
2625
use Elasticsearch\Common\Exceptions\Missing404Exception;
2726
use Elasticsearch\Common\Exceptions\NoNodesAvailableException;
2827

2928
final class ElasticsearchProviderResourceMetadataCollectionFactory implements ResourceMetadataCollectionFactoryInterface
3029
{
31-
public function __construct(private readonly ?Client $client, private readonly ResourceMetadataCollectionFactoryInterface $decorated, private readonly bool $triggerDeprecation = true, private readonly ?InflectorInterface $inflector = new Inflector()) // @phpstan-ignore-line
30+
public function __construct(private readonly ?Client $client, private readonly ResourceMetadataCollectionFactoryInterface $decorated, private readonly bool $triggerDeprecation = true, private readonly ?InflectorInterface $inflector = null) // @phpstan-ignore-line
3231
{
32+
if ($client) {
33+
trigger_deprecation('api-platform/core', '4.0', sprintf('Using $client at "%s" is deprecated and the argument will be removed.', self::class));
34+
}
3335
}
3436

3537
/**

src/Exception/DeserializationException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
*
2121
* @author Samuel ROZE <[email protected]>
2222
* @author Kévin Dunglas <[email protected]>
23+
*
24+
* @deprecated
2325
*/
2426
class DeserializationException extends \Exception implements ExceptionInterface, SerializerExceptionInterface
2527
{

src/Exception/ErrorCodeSerializableInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
/**
1717
* An exception which has a serializable application-specific error code.
18+
*
19+
* @deprecated
1820
*/
1921
interface ErrorCodeSerializableInterface
2022
{

src/Exception/ExceptionInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* Base exception interface.
1818
*
1919
* @author Kévin Dunglas <[email protected]>
20+
*
21+
* @deprecated use ApiPlatform\Metadata\Exception\ExceptionInterface
2022
*/
2123
interface ExceptionInterface extends \Throwable
2224
{

src/Exception/InvalidArgumentException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* Invalid argument exception.
1818
*
1919
* @author Kévin Dunglas <[email protected]>
20+
*
21+
* @deprecated use ApiPlatform\Metadata\Exception\InvalidArgumentException
2022
*/
2123
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
2224
{

src/Exception/InvalidIdentifierException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* Identifier is not valid exception.
1818
*
1919
* @author Antoine Bluchet <[email protected]>
20+
*
21+
* @deprecated use ApiPlatform\Metadata\Exception\InvalidIdentifierException
2022
*/
2123
class InvalidIdentifierException extends \Exception implements ExceptionInterface
2224
{

src/Exception/InvalidResourceException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* Invalid resource exception.
1818
*
1919
* @author Paul Le Corre <[email protected]>
20+
*
21+
* @deprecated
2022
*/
2123
class InvalidResourceException extends \Exception implements ExceptionInterface
2224
{

0 commit comments

Comments
 (0)