1 | <?php |
||
10 | class GoogleClient |
||
11 | { |
||
12 | /** |
||
13 | * @var Google_Service_Analytics |
||
14 | */ |
||
15 | protected $service; |
||
16 | |||
17 | /** |
||
18 | * @var \Spatie\Analytics\Cache |
||
19 | */ |
||
20 | protected $cache; |
||
21 | |||
22 | /** |
||
23 | * @var int |
||
24 | */ |
||
25 | protected $cacheLifeTimeInMinutes; |
||
26 | |||
27 | /** |
||
28 | * @var int |
||
29 | */ |
||
30 | protected $realTimeCacheLifeTimeInSeconds; |
||
31 | |||
32 | /** |
||
33 | * @param Google_Client $client |
||
34 | * @param \Spatie\Analytics\Cache $cache |
||
35 | * @param int $cacheLifeTimeInMinutes |
||
36 | * @param int $realTimeCacheLifeTimeInSeconds |
||
37 | */ |
||
38 | public function __construct( |
||
50 | |||
51 | /** |
||
52 | * Query the Google Analytics Service with given parameters. |
||
53 | * |
||
54 | * @param int $id |
||
55 | * @param string $startDate |
||
56 | * @param string $endDate |
||
57 | * @param string $metrics |
||
58 | * @param array $others |
||
59 | * @return mixed |
||
60 | */ |
||
61 | public function performQuery($id, $startDate, $endDate, $metrics, array $others = array()) |
||
77 | |||
78 | /** |
||
79 | * Query the Google Analytics Real Time Reporting Service with given parameters. |
||
80 | * |
||
81 | * @param int $id |
||
82 | * @param string $metrics |
||
83 | * @param array $others |
||
84 | * @return mixed |
||
85 | */ |
||
86 | public function performRealTimeQuery($id, $metrics, array $others = array()) |
||
106 | |||
107 | /** |
||
108 | * Get a site Id by its URL. |
||
109 | * |
||
110 | * @param string $url |
||
111 | * @return mixed |
||
112 | * @throws \Exception |
||
113 | */ |
||
114 | public function getSiteIdByUrl($url) |
||
124 | |||
125 | /** |
||
126 | * Get all siteIds. |
||
127 | * |
||
128 | * @return array |
||
129 | */ |
||
130 | public function getAllSiteIds() |
||
144 | |||
145 | /** |
||
146 | * Determine the cache name for the set of query properties given. |
||
147 | * |
||
148 | * @param array $properties |
||
149 | * @return string |
||
150 | */ |
||
151 | protected function determineCacheName(array $properties) |
||
155 | |||
156 | /** |
||
157 | * Determine if request to Google should be cached. |
||
158 | * |
||
159 | * @return bool |
||
160 | */ |
||
161 | protected function useCache() |
||
165 | |||
166 | /** |
||
167 | * Set the cache time. |
||
168 | * |
||
169 | * @param int $cacheLifeTimeInMinutes |
||
170 | * @return self |
||
171 | */ |
||
172 | public function setCacheLifeTimeInMinutes($cacheLifeTimeInMinutes) |
||
178 | |||
179 | /** |
||
180 | * Determine the cache name for RealTime function calls for the set of query properties given. |
||
181 | * |
||
182 | * @param array $properties |
||
183 | * @return string |
||
184 | */ |
||
185 | protected function determineRealTimeCacheName(array $properties) |
||
189 | |||
190 | /** |
||
191 | * Determine if RealTime request to Google should be cached. |
||
192 | * |
||
193 | * @return bool |
||
194 | */ |
||
195 | protected function useRealTimeCache() |
||
199 | |||
200 | /** |
||
201 | * Set the cache time. |
||
202 | * |
||
203 | * @param int $realTimeCacheLifeTimeInSeconds |
||
204 | * @return self |
||
205 | */ |
||
206 | public function setRealTimeCacheLifeTimeInMinutes($realTimeCacheLifeTimeInSeconds) |
||
212 | } |
||
213 |
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: