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