Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| Report_Request | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * One report request. |
| 4 | * |
| 5 | * @package automattic/jetpack-woocommerce-stats |
| 6 | */ |
| 7 | |
| 8 | namespace Automattic\Jetpack\WooCommerceStats\Report_Execution; |
| 9 | |
| 10 | /** |
| 11 | * The report, route and params a handler serves. |
| 12 | * |
| 13 | * @since 0.3.3 |
| 14 | */ |
| 15 | class Report_Request { |
| 16 | |
| 17 | /** |
| 18 | * The report. |
| 19 | * |
| 20 | * @var Report_Definition |
| 21 | */ |
| 22 | public $definition; |
| 23 | |
| 24 | /** |
| 25 | * The route as requested, trailing slash included. |
| 26 | * |
| 27 | * @var string |
| 28 | */ |
| 29 | public $route; |
| 30 | |
| 31 | /** |
| 32 | * The report's query params, as sent. |
| 33 | * |
| 34 | * @var array |
| 35 | */ |
| 36 | public $params; |
| 37 | |
| 38 | /** |
| 39 | * Whether to skip caches. |
| 40 | * |
| 41 | * @var bool |
| 42 | */ |
| 43 | public $force_refresh; |
| 44 | |
| 45 | /** |
| 46 | * Constructor. |
| 47 | * |
| 48 | * @param Report_Definition $definition The report. |
| 49 | * @param string $route The route as requested. |
| 50 | * @param array $params The report's query params, as sent. |
| 51 | * @param bool $force_refresh Whether to skip caches. |
| 52 | */ |
| 53 | public function __construct( Report_Definition $definition, $route, array $params, $force_refresh = false ) { |
| 54 | $this->definition = $definition; |
| 55 | $this->route = $route; |
| 56 | $this->params = $params; |
| 57 | $this->force_refresh = $force_refresh; |
| 58 | } |
| 59 | } |