1 | <?php |
||
12 | class AnalyticsDataFetcher |
||
13 | { |
||
14 | /** |
||
15 | * @var CacheItemPoolInterface cache |
||
16 | */ |
||
17 | protected $cache; |
||
18 | |||
19 | /** |
||
20 | * @var \Google_Client client |
||
21 | */ |
||
22 | protected $client; |
||
23 | |||
24 | /** |
||
25 | * @var int profileId |
||
26 | */ |
||
27 | protected $viewId; |
||
28 | |||
29 | /** |
||
30 | * @var int cacheLifetime |
||
31 | */ |
||
32 | protected $cacheLifetime; |
||
33 | |||
34 | public function __construct(CacheItemPoolInterface $cache, \Google_Client $client, string $viewId, int $cacheLifetime) |
||
41 | |||
42 | /** |
||
43 | * Get page views for the given url. |
||
44 | * |
||
45 | * @return mixed |
||
46 | */ |
||
47 | public function getPageViews(string $uri, \DateTimeInterface $startTime = null, \DateTimeInterface $endTime = null, string $regex = '$', array $params = []) |
||
93 | |||
94 | public function getPageViewsAsInteger(string $uri, \DateTimeInterface $startTime = null, \DateTimeInterface $endTime = null, string $regex = '$'): int |
||
100 | } |
||
101 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.