Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | /** |
| 3 | * Serves one report, or every report, for one provider. |
| 4 | * |
| 5 | * @package automattic/jetpack-woocommerce-stats |
| 6 | */ |
| 7 | |
| 8 | namespace Automattic\Jetpack\WooCommerceStats\Report_Execution; |
| 9 | |
| 10 | use WP_Error; |
| 11 | |
| 12 | /** |
| 13 | * Registered by (report id, provider). The executor picks one per request and runs it. |
| 14 | * |
| 15 | * @internal Not a stable contract yet: the signature changes in the next steps. |
| 16 | * |
| 17 | * @since 0.3.3 |
| 18 | */ |
| 19 | interface Report_Handler { |
| 20 | |
| 21 | /** |
| 22 | * Serve the request. A request naming no provider reaches this without the provider's readiness check. |
| 23 | * |
| 24 | * @param Report_Request $request The request. |
| 25 | * @return array|WP_Error `data`, `status` and `headers`. |
| 26 | */ |
| 27 | public function run( Report_Request $request ); |
| 28 | } |