1 | <?php |
||
13 | final class RequestStackProvider |
||
14 | { |
||
15 | /** |
||
16 | * Array that tell if a request errored or not. true = success, false = failure. |
||
17 | * |
||
18 | * @var array |
||
19 | */ |
||
20 | private $failures; |
||
21 | |||
22 | /** |
||
23 | * A multidimensional array with requests. |
||
24 | * $requests[0][0] is the first request before all plugins. |
||
25 | * $requests[0][1] is the first request after the first plugin. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | private $requests; |
||
30 | |||
31 | /** |
||
32 | * A multidimensional array with responses. |
||
33 | * $responses[0][0] is the first responses before all plugins. |
||
34 | * $responses[0][1] is the first responses after the first plugin. |
||
35 | * |
||
36 | * @var array |
||
37 | */ |
||
38 | private $responses; |
||
39 | |||
40 | /** |
||
41 | * @param array $failures if the response was successful or not |
||
42 | * @param array $requests |
||
43 | * @param array $responses |
||
44 | */ |
||
45 | public function __construct(array $failures, array $requests, array $responses) |
||
51 | |||
52 | /** |
||
53 | * Create an array of ClientDataCollector from collected data. |
||
54 | * |
||
55 | * @param array $data |
||
56 | * |
||
57 | * @return RequestStackProvider[] |
||
58 | */ |
||
59 | public static function createFromCollectedData(array $data) |
||
68 | |||
69 | /** |
||
70 | * @param array $messages is an array with keys 'failure', 'request' and 'response' which hold requests for each call to |
||
71 | * sendRequest and for each depth |
||
72 | * |
||
73 | * @return RequestStackProvider |
||
74 | */ |
||
75 | private static function createOne($messages) |
||
101 | |||
102 | /** |
||
103 | * Get the index keys for the request and response stacks. |
||
104 | * |
||
105 | * @return array |
||
106 | */ |
||
107 | public function getStackIndexKeys() |
||
111 | |||
112 | /** |
||
113 | * @param int $idx |
||
114 | * |
||
115 | * @return array |
||
116 | */ |
||
117 | public function getRequestStack($idx) |
||
118 | { |
||
119 | return $this->requests[$idx]; |
||
120 | } |
||
121 | |||
122 | /** |
||
123 | * @param int $idx |
||
124 | * |
||
125 | * @return array |
||
126 | */ |
||
127 | public function getResponseStack($idx) |
||
131 | |||
132 | /** |
||
133 | * @param int $idx |
||
134 | * |
||
135 | * @return array |
||
136 | */ |
||
137 | public function getFailureStack($idx) |
||
141 | } |
||
142 |
Late static binding only has effect in subclasses. A
final
class cannot be extended anymore so late static binding cannot occurr. Consider replacingstatic::
withself::
.To learn more about late static binding, please refer to the PHP core documentation.