1 | <?php |
||
30 | class ApiService |
||
31 | { |
||
32 | /** |
||
33 | * @var ClientInterface |
||
34 | */ |
||
35 | private $guzzleClient; |
||
36 | |||
37 | /** |
||
38 | * @param ClientInterface $guzzleClient A Guzzle client preconfigured with base URL and proper authentication. |
||
39 | */ |
||
40 | public function __construct(ClientInterface $guzzleClient) |
||
44 | |||
45 | /** |
||
46 | * @param string $path A URL path, optionally containing printf parameters (e.g. '/a/b/%s/d'). The parameters |
||
47 | * will be URL encoded and formatted into the path string. |
||
48 | * Example: '/institution/%s/identity/%s', ['institution' => 'ab-cd', 'identity' => 'ef'] |
||
49 | * @param array $parameters An array containing the parameters to replace in the path. |
||
50 | * @param HttpQuery $httpQuery|null |
||
|
|||
51 | * @return null|mixed Most likely an array structure, null when the resource doesn't exist. |
||
52 | * @throws AccessDeniedToResourceException When the consumer isn't authorised to access given resource. |
||
53 | * @throws ResourceReadException When the server doesn't respond with the resource. |
||
54 | * @throws MalformedResponseException When the server doesn't respond with (well-formed) JSON. |
||
55 | */ |
||
56 | public function read($path, array $parameters = [], HttpQuery $httpQuery = null) |
||
89 | |||
90 | /** |
||
91 | * @param string $path |
||
92 | * @param array $parameters |
||
93 | * @param HttpQuery|null $httpQuery |
||
94 | * @return string |
||
95 | */ |
||
96 | private function buildResourcePath($path, array $parameters, HttpQuery $httpQuery = null) |
||
121 | } |
||
122 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.