OrderWithdrawalController.php
2 weeks ago
OrderWithdrawalFeatureHighlightNotification.php
2 weeks ago
OrderWithdrawalFormProcessor.php
2 weeks ago
OrderWithdrawalFormState.php
2 weeks ago
OrderWithdrawalFormView.php
2 weeks ago
OrderWithdrawalFormState.php
49 lines
| 1 | <?php |
| 2 | declare( strict_types = 1 ); |
| 3 | |
| 4 | namespace Automattic\WooCommerce\Internal\OrderWithdrawal; |
| 5 | |
| 6 | /** |
| 7 | * Holds the processed order withdrawal form state. |
| 8 | * |
| 9 | * @internal Just for internal use. |
| 10 | */ |
| 11 | final class OrderWithdrawalFormState { |
| 12 | |
| 13 | /** |
| 14 | * Current screen. |
| 15 | * |
| 16 | * @var string |
| 17 | */ |
| 18 | public string $screen; |
| 19 | |
| 20 | /** |
| 21 | * Sanitized form data. |
| 22 | * |
| 23 | * @var array<string,string> |
| 24 | */ |
| 25 | public array $data; |
| 26 | |
| 27 | /** |
| 28 | * Validation errors keyed by field. |
| 29 | * |
| 30 | * @var array<string,string> |
| 31 | */ |
| 32 | public array $errors; |
| 33 | |
| 34 | /** |
| 35 | * Initialize form state. |
| 36 | * |
| 37 | * @param string $screen Current screen. |
| 38 | * @param array<string,string> $data Sanitized form data. |
| 39 | * @param array<string,string> $errors Validation errors keyed by field. |
| 40 | * |
| 41 | * @since 11.1.0 |
| 42 | */ |
| 43 | public function __construct( string $screen, array $data, array $errors ) { |
| 44 | $this->screen = $screen; |
| 45 | $this->data = $data; |
| 46 | $this->errors = $errors; |
| 47 | } |
| 48 | } |
| 49 |