| 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 canBeImpersonated() |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Impersonate the given user. |
||
| 34 | * |
||
| 35 | * @param Model $user |
||
| 36 | * @return bool |
||
| 37 | */ |
||
| 38 | public function impersonate(Model $user) |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Check if the current user is impersonated. |
||
| 45 | * |
||
| 46 | * @param void |
||
| 47 | * @return bool |
||
| 48 | */ |
||
| 49 | public function isImpersonated() |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Leave the current impersonation. |
||
| 56 | * |
||
| 57 | * @param void |
||
| 58 | * @return bool |
||
| 59 | */ |
||
| 60 | public function leaveImpersonation() |
||
| 67 | } |
||
| 68 |
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
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.