1 | <?php |
||
28 | class RaCandidateService |
||
29 | { |
||
30 | /** |
||
31 | * @var LibraryRaCandidateService |
||
32 | */ |
||
33 | private $libraryService; |
||
34 | |||
35 | /** |
||
36 | * @var ValidatorInterface |
||
37 | */ |
||
38 | private $validator; |
||
39 | |||
40 | /** |
||
41 | * @param LibraryRaCandidateService $libraryService |
||
42 | * @param ValidatorInterface $validator |
||
43 | */ |
||
44 | public function __construct(LibraryRaCandidateService $libraryService, ValidatorInterface $validator) |
||
49 | |||
50 | /** |
||
51 | * @param RaCandidateSearchQuery $query |
||
52 | * @return RaCandidateCollection |
||
53 | */ |
||
54 | public function search(RaCandidateSearchQuery $query) |
||
70 | |||
71 | /** |
||
72 | * @param string $identityId |
||
73 | * @param string $institution |
||
|
|||
74 | * @param string $actorId |
||
75 | * @return RaCandidateInstitutions |
||
76 | */ |
||
77 | public function get($identityId, $actorId) |
||
78 | { |
||
79 | $data = $this->libraryService->get($identityId, $actorId); |
||
80 | |||
81 | if ($data === null) { |
||
82 | return null; |
||
83 | } |
||
84 | |||
85 | $raCandidateInstitutions = RaCandidateInstitutions::fromData($data); |
||
86 | |||
87 | $this->assertIsValid($raCandidateInstitutions, 'Received invalid RaCandidate'); |
||
88 | |||
89 | return $raCandidateInstitutions; |
||
90 | } |
||
91 | |||
92 | /** |
||
93 | * @param mixed $value |
||
94 | * @param string $message |
||
95 | */ |
||
96 | private function assertIsValid($value, $message) |
||
104 | } |
||
105 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.