| 1 |
<?php |
| 2 |
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure. |
| 3 |
namespace Yoast\WP\SEO\Schema_Aggregator\Domain; |
| 4 |
|
| 5 |
/** |
| 6 |
* Interface for external schema piece repositories. |
| 7 |
* |
| 8 |
* Implementations provide schema pieces from external sources (e.g., WooCommerce, EDD). |
| 9 |
*/ |
| 10 |
interface External_Schema_Piece_Repository_Interface { |
| 11 |
|
| 12 |
/** |
| 13 |
* Checks if this repository supports the given post type. |
| 14 |
* |
| 15 |
* @param string $post_type The post type to check. |
| 16 |
* |
| 17 |
* @return bool True if this repository can provide schema for the post type. |
| 18 |
*/ |
| 19 |
public function supports( string $post_type ): bool; |
| 20 |
|
| 21 |
/** |
| 22 |
* Collects external schema pieces for the given post. |
| 23 |
* |
| 24 |
* @param int $post_id The post ID. |
| 25 |
* |
| 26 |
* @return array<array<string,string|int|bool|array>> The schema pieces (always an array, may be empty). |
| 27 |
*/ |
| 28 |
public function collect( int $post_id ): array; |
| 29 |
} |
| 30 |
|