1 | <?php |
||
14 | class UserController extends BaseController |
||
15 | { |
||
16 | /** @var UserService */ |
||
17 | private $userService; |
||
18 | |||
19 | public function init() |
||
24 | |||
25 | /** |
||
26 | * Fetch user details |
||
27 | * @SWG\Get( |
||
28 | * path="/user/{id}", |
||
29 | * tags={"users"}, |
||
30 | * @SWG\Parameter( |
||
31 | * name="id", |
||
32 | * in="path", |
||
33 | * type="integer", |
||
34 | * description="the type of response", |
||
35 | * required=false, |
||
36 | * default=1 |
||
37 | * ), |
||
38 | * @SWG\Response(response="200", description="Sends user details") |
||
39 | * ) |
||
40 | * |
||
41 | */ |
||
42 | public function indexAction() |
||
54 | |||
55 | /** |
||
56 | * Register as a new user. |
||
57 | * @SWG\Post( |
||
58 | * path="/user/register", |
||
59 | * tags={"users"}, |
||
60 | * @SWG\Response(response="200", description="Registers a new unactivated user"), |
||
61 | * @SWG\Parameter( |
||
62 | * name="email", |
||
63 | * in="formData", |
||
64 | * type="string", |
||
65 | * description="the users email", |
||
66 | * required=true, |
||
67 | * default="[email protected]" |
||
68 | * ), |
||
69 | * @SWG\Parameter( |
||
70 | * name="password", |
||
71 | * in="formData", |
||
72 | * type="string", |
||
73 | * description="a password for the user", |
||
74 | * required=true, |
||
75 | * default="password" |
||
76 | * ), |
||
77 | * @SWG\Parameter( |
||
78 | * name="confirm", |
||
79 | * in="formData", |
||
80 | * type="string", |
||
81 | * description="password confirmation", |
||
82 | * required=true, |
||
83 | * default="password" |
||
84 | * ) |
||
85 | * ) |
||
86 | * @throws Exception |
||
87 | */ |
||
88 | public function registerAction() |
||
126 | |||
127 | |||
128 | |||
129 | /** |
||
130 | * Activate from the email link. |
||
131 | * @SWG\Get( |
||
132 | * path="/user/activate/{email}/{token}", |
||
133 | * tags={"users"}, |
||
134 | * @SWG\Response(response="200", description="Registers a new unactivated user"), |
||
135 | * @SWG\Parameter( |
||
136 | * name="email", |
||
137 | * in="path", |
||
138 | * type="string", |
||
139 | * description="the users email", |
||
140 | * required=true, |
||
141 | * default="[email protected]" |
||
142 | * ), |
||
143 | * @SWG\Parameter( |
||
144 | * name="token", |
||
145 | * in="path", |
||
146 | * type="string", |
||
147 | * description="the email link token", |
||
148 | * required=true, |
||
149 | * default="r4nd0mT0k3n" |
||
150 | * ) |
||
151 | * ) |
||
152 | * @throws Exception |
||
153 | */ |
||
154 | public function activateAction() |
||
193 | } |
||
194 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.