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 | * Whether a handler can serve one request's values. |
| 4 | * |
| 5 | * @package automattic/jetpack-woocommerce-stats |
| 6 | */ |
| 7 | |
| 8 | namespace Automattic\Jetpack\WooCommerceStats\Report_Execution; |
| 9 | |
| 10 | use WP_Error; |
| 11 | |
| 12 | /** |
| 13 | * Implemented by a `Report_Handler` that refuses some values of the params it declares, such as a |
| 14 | * range too long to serve. One that doesn't implement it supports every request it covers. |
| 15 | * |
| 16 | * @internal Not a stable contract yet: the signature changes in the next steps. |
| 17 | * |
| 18 | * @since 0.5.0 |
| 19 | */ |
| 20 | interface Report_Support { |
| 21 | |
| 22 | /** |
| 23 | * Whether the handler can serve this request. Checked before readiness, for a request naming a provider. |
| 24 | * |
| 25 | * @param Report_Request $request The request. |
| 26 | * @return true|WP_Error A 400 for a missing or malformed value, or a 422 for one the handler cannot serve. |
| 27 | */ |
| 28 | public function supports( Report_Request $request ); |
| 29 | } |