Arrayable.php
26 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Interface requiring to_array for objects that can be flattened to associative arrays. |
| 5 | * Used by DTOs, resources, and collections for serialization. |
| 6 | * Foundation for JSON encoding and API responses. |
| 7 | * |
| 8 | * @package Framework |
| 9 | * @subpackage Contracts\Support |
| 10 | * @since 1.0.0 |
| 11 | */ |
| 12 | namespace Kirki\Framework\Contracts\Support; |
| 13 | |
| 14 | \defined('ABSPATH') || exit; |
| 15 | interface Arrayable |
| 16 | { |
| 17 | /** |
| 18 | * Convert the object to an array. |
| 19 | * |
| 20 | * @return array The array representation of the object |
| 21 | * |
| 22 | * @since 1.0.0 |
| 23 | */ |
| 24 | public function to_array(); |
| 25 | } |
| 26 |