Conditions | 4 |
Paths | 3 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
46 | public function call(string $method, array $params = [], string $format = 'php') |
||
47 | { |
||
48 | $params['method'] = $method; |
||
49 | $params['token_auth'] = $this->token; |
||
50 | $params['format'] = $format; |
||
51 | $data = $this->getConnection()->send($params); |
||
52 | |||
53 | if ('php' === $format) { |
||
54 | $object = unserialize($data); |
||
55 | |||
56 | if (isset($object['result']) && 'error' === $object['result']) { |
||
57 | throw new MatomoException($object['message']); |
||
58 | } |
||
59 | |||
60 | return $object; |
||
61 | } |
||
62 | |||
63 | return $data; |
||
64 | } |
||
65 | |||
71 |