1 | <?php |
||
13 | class ClientDataCollector |
||
14 | { |
||
15 | /** |
||
16 | * A multidimensional array with requests. |
||
17 | * $requests[0][0] is the first request before all plugins. |
||
18 | * $requests[0][1] is the first request after the first plugin. |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | private $requests; |
||
23 | |||
24 | /** |
||
25 | * A multidimensional array with responses. |
||
26 | * $responses[0][0] is the first responses before all plugins. |
||
27 | * $responses[0][1] is the first responses after the first plugin. |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | private $responses; |
||
32 | |||
33 | /** |
||
34 | * |
||
35 | * @param array $requests |
||
36 | * @param array $responses |
||
37 | */ |
||
38 | public function __construct(array $requests, array $responses) |
||
43 | |||
44 | /** |
||
45 | * Create an array of ClientDataCollector from collected data. |
||
46 | * |
||
47 | * @param array $data |
||
48 | * |
||
49 | * @return ClientDataCollector[] |
||
50 | */ |
||
51 | public static function createFromCollectedData(array $data) |
||
60 | |||
61 | /** |
||
62 | * @param array $messages |
||
63 | * |
||
64 | * @return ClientDataCollector |
||
65 | */ |
||
66 | private static function createOne($messages) |
||
85 | |||
86 | /** |
||
87 | * @return array |
||
88 | */ |
||
89 | public function getRequests() |
||
93 | |||
94 | /** |
||
95 | * @param array $requests |
||
96 | * |
||
97 | * @return ClientDataCollector |
||
98 | */ |
||
99 | public function setRequests($requests) |
||
105 | |||
106 | /** |
||
107 | * @return array |
||
108 | */ |
||
109 | public function getResponses() |
||
113 | |||
114 | /** |
||
115 | * @param array $responses |
||
116 | * |
||
117 | * @return ClientDataCollector |
||
118 | */ |
||
119 | public function setResponses($responses) |
||
125 | |||
126 | /** |
||
127 | * Get the index keys for the request and response stacks. |
||
128 | * |
||
129 | * @return array |
||
130 | */ |
||
131 | public function getStackIndexKeys() |
||
135 | |||
136 | /** |
||
137 | * @param int $idx |
||
138 | * |
||
139 | * @return array responses |
||
140 | */ |
||
141 | public function getRequstStack($idx) |
||
145 | |||
146 | /** |
||
147 | * @param int $idx |
||
148 | * |
||
149 | * @return array responses |
||
150 | */ |
||
151 | public function getResponseStack($idx) |
||
155 | } |
Let’s assume you have a class which uses late-static binding:
}
The code above will run fine in your PHP runtime. However, if you now create a sub-class and call the
getSomeVariable()
on that sub-class, you will receive a runtime error:In the case above, it makes sense to update
SomeClass
to useself
instead: