1 | <?php namespace Qualia; |
||
9 | class Client |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | protected $survey; |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $token; |
||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $endpoint; |
||
23 | |||
24 | 84 | public function __construct($survey, $token, $endpoint = 'api.qualiaanalytics.org') |
|
25 | { |
||
26 | 84 | $this->survey = $survey; |
|
27 | 84 | $this->token = $token; |
|
28 | 84 | $this->endpoint = $endpoint; |
|
29 | |||
30 | 84 | $template = Request::init() |
|
31 | 84 | ->withStrictSSL() |
|
32 | 84 | ->addHeader('Authorization', 'token') |
|
33 | 84 | ->addHeader('User-Agent', 'Qualia API/PHP/'. PHP_VERSION . ' (' . PHP_OS . ')') |
|
34 | 84 | ->parseWith(function($body) { |
|
35 | 72 | return json_decode($body, true); |
|
36 | 84 | }) |
|
37 | 84 | ->sendsAndExpects(Mime::JSON); |
|
38 | |||
39 | 84 | Request::ini($template); |
|
40 | 84 | } |
|
41 | |||
42 | /** |
||
43 | * Get the provided survey |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | 78 | public function getSurveyId() |
|
51 | |||
52 | 72 | public function post($url, $data = array(), $additional = array()) |
|
75 | |||
76 | 6 | public function get($url) |
|
85 | } |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.