1 | <?php |
||
13 | class UserFactory |
||
14 | { |
||
15 | /** |
||
16 | * @var UserRepository |
||
17 | */ |
||
18 | private $userRepository; |
||
19 | |||
20 | /** |
||
21 | * @param EntityManagerInterface $em |
||
|
|||
22 | */ |
||
23 | public function __construct(UserRepository $userRepository) |
||
27 | |||
28 | /** |
||
29 | * @param array $data |
||
30 | * |
||
31 | * @return User |
||
32 | * |
||
33 | * @throws InvalidResponseException |
||
34 | */ |
||
35 | public function createFromArray(array $data): User |
||
54 | |||
55 | /** |
||
56 | * @param UserDTO $userData |
||
57 | * |
||
58 | * @return User |
||
59 | * |
||
60 | * @throws ApiException |
||
61 | * @throws InvalidUserDataException |
||
62 | */ |
||
63 | public function createFromDTO(UserDTO $userData): User |
||
82 | |||
83 | /** |
||
84 | * @param array $data |
||
85 | * |
||
86 | * @throws InvalidResponseException |
||
87 | */ |
||
88 | private function validateArrayData(array $data) |
||
94 | |||
95 | /** |
||
96 | * @param UserDTO $data |
||
97 | * |
||
98 | * @throws InvalidResponseException |
||
99 | */ |
||
100 | private function validateDTOData(UserDTO $data) |
||
106 | } |
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.