1 | <?php |
||
5 | class Xhgui_Profiles |
||
6 | { |
||
7 | /** |
||
8 | * @var Xhgui_StorageInterface |
||
9 | */ |
||
10 | protected $storage; |
||
11 | |||
12 | /** |
||
13 | * Xhgui_Profiles constructor. |
||
14 | * @param Xhgui_StorageInterface $storage |
||
15 | */ |
||
16 | public function __construct(\Xhgui_StorageInterface $storage) |
||
20 | |||
21 | /** |
||
22 | * @param $conditions |
||
23 | * @param null $fields |
||
24 | * @return mixed |
||
25 | */ |
||
26 | public function query($conditions, $fields = null) |
||
30 | |||
31 | /** |
||
32 | * Get a single profile run by id. |
||
33 | * |
||
34 | * @param string $id The id of the profile to get. |
||
35 | * @return Xhgui_Profile |
||
36 | * @throws Exception |
||
37 | */ |
||
38 | public function get($id) |
||
42 | |||
43 | /** |
||
44 | * Get the list of profiles for a simplified url. |
||
45 | * |
||
46 | * @param string $url The url to load profiles for. |
||
47 | * @param array $options Pagination options to use. |
||
48 | * @param array $conditions The search options. |
||
49 | * @return MongoCursor |
||
50 | */ |
||
51 | public function getForUrl($url, $options, $conditions = array()) |
||
62 | |||
63 | /** |
||
64 | * @param Xhgui_Storage_Filter $filter |
||
65 | * @return array |
||
66 | * @throws Exception |
||
67 | */ |
||
68 | public function paginate(Xhgui_Storage_Filter $filter) |
||
90 | |||
91 | /** |
||
92 | * Get the Percentile metrics for a URL |
||
93 | * |
||
94 | * This will group data by date and returns only the |
||
95 | * percentile + date, making the data ideal for time series graphs |
||
96 | * |
||
97 | * @param integer $percentile The percentile you want. e.g. 90. |
||
98 | * @param string $url |
||
99 | * @param array $search Search options containing startDate and or endDate |
||
100 | * @return array Array of metrics grouped by date |
||
101 | */ |
||
102 | public function getPercentileForUrl($percentile, $url, $filter) |
||
133 | |||
134 | /** |
||
135 | * Get a paginated set of results. |
||
136 | * |
||
137 | * @param array $options The find options to use. |
||
138 | * @return array An array of result data. |
||
139 | */ |
||
140 | public function getAll($filter) |
||
144 | |||
145 | /** |
||
146 | * Insert a profile run. |
||
147 | * |
||
148 | * Does unchecked inserts. |
||
149 | * |
||
150 | * @param array $profile The profile data to save. |
||
151 | * @return |
||
152 | */ |
||
153 | public function insert($profile) |
||
157 | |||
158 | /** |
||
159 | * Delete a profile run. |
||
160 | * |
||
161 | * @param string $id The profile id to delete. |
||
162 | * @return array|bool |
||
163 | */ |
||
164 | public function delete($id) |
||
168 | |||
169 | /** |
||
170 | * Used to truncate a collection. |
||
171 | * |
||
172 | * Primarly used in test cases to reset the test db. |
||
173 | * |
||
174 | * @return boolean |
||
175 | */ |
||
176 | public function truncate() |
||
180 | |||
181 | /** |
||
182 | * Converts arrays + MongoCursors into Xhgui_Profile instances. |
||
183 | * |
||
184 | * @param array|MongoCursor $data The data to transform. |
||
185 | * @return Xhgui_Profile|array The transformed/wrapped results. |
||
186 | * @throws Exception |
||
187 | */ |
||
188 | protected function wrap($data) |
||
204 | |||
205 | /** |
||
206 | * @return Xhgui_StorageInterface |
||
207 | */ |
||
208 | public function getStorage() |
||
212 | |||
213 | /** |
||
214 | * @param Xhgui_StorageInterface $storage |
||
215 | */ |
||
216 | public function setStorage($storage) |
||
220 | } |
||
221 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: