ArrayOf.php
2 months ago
ConnectionOf.php
2 months ago
Deprecated.php
2 months ago
Description.php
2 months ago
Experimental.php
4 weeks ago
HiddenFromMetadataQuery.php
4 weeks ago
Ignore.php
2 months ago
Internal.php
4 weeks ago
Metadata.php
4 weeks ago
Name.php
2 months ago
Parameter.php
2 months ago
ParameterDescription.php
2 months ago
PublicAccess.php
4 weeks ago
RequiredCapability.php
4 weeks ago
ReturnType.php
2 months ago
ScalarType.php
2 months ago
Unroll.php
2 months ago
Deprecated.php
29 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Automattic\WooCommerce\Api\Attributes; |
| 6 | |
| 7 | use Attribute; |
| 8 | |
| 9 | /** |
| 10 | * Marks a field or enum value as deprecated in the GraphQL schema. |
| 11 | * |
| 12 | * Deprecated elements remain functional but are flagged with a deprecation |
| 13 | * reason in introspection, signaling to API consumers that they should |
| 14 | * migrate to an alternative. |
| 15 | */ |
| 16 | #[Attribute] |
| 17 | final class Deprecated { |
| 18 | /** |
| 19 | * Constructor. |
| 20 | * |
| 21 | * @param string $reason A human-readable explanation of why the element is |
| 22 | * deprecated and what to use instead. |
| 23 | */ |
| 24 | public function __construct( |
| 25 | public readonly string $reason, |
| 26 | ) { |
| 27 | } |
| 28 | } |
| 29 |