1 | <?php |
||
8 | trait Impersonate |
||
9 | { |
||
10 | /** |
||
11 | * Return true or false if the user can impersonate an other user. |
||
12 | * |
||
13 | * @param void |
||
14 | * @return bool |
||
15 | */ |
||
16 | public function canImpersonate() |
||
20 | |||
21 | /** |
||
22 | * Return true or false if the user can be impersonate. |
||
23 | * |
||
24 | * @param Model $user |
||
|
|||
25 | * @return bool |
||
26 | */ |
||
27 | public function canBeImpersonate() |
||
31 | |||
32 | /** |
||
33 | * Impersonate the given user. |
||
34 | * |
||
35 | * @param Model $user |
||
36 | * @return bool |
||
37 | */ |
||
38 | public function impersonate(Model $user) |
||
46 | |||
47 | /** |
||
48 | * Check if the current user is impersonated. |
||
49 | * |
||
50 | * @param void |
||
51 | * @return bool |
||
52 | */ |
||
53 | public function isImpersonated() |
||
57 | |||
58 | /** |
||
59 | * Leave the current impersonation. |
||
60 | * |
||
61 | * @param void |
||
62 | * @return bool |
||
63 | */ |
||
64 | public function leaveImpersonation() |
||
71 | } |
||
72 |
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.