1 | <?php |
||
8 | class User extends AbstractModel |
||
9 | { |
||
10 | /** |
||
11 | * The current user logged in. |
||
12 | * -1 before initialization |
||
13 | * null if no user logged in |
||
14 | * \mQueue\Model\User if logged in |
||
15 | * |
||
16 | * @var \mQueue\Model\User |
||
17 | */ |
||
18 | private static $currentUser = -1; |
||
19 | |||
20 | /** |
||
21 | * Returns the user currently logged in or null |
||
22 | * |
||
23 | * @return null|\mQueue\Model\User |
||
24 | */ |
||
25 | 13 | public static function getCurrent() |
|
38 | |||
39 | /** |
||
40 | * Set the user currently logged in, or log him out |
||
41 | * |
||
42 | * @param \mQueue\Model\User $user |
||
|
|||
43 | */ |
||
44 | 2 | public static function setCurrent(DefaultModelUser $user = null): void |
|
50 | |||
51 | /** |
||
52 | * Returns movie ratings statistics |
||
53 | * |
||
54 | * @return array of count of movies per ratings |
||
55 | */ |
||
56 | 1 | public function getStatistics() |
|
60 | |||
61 | /** |
||
62 | * Override parent to auto-logout when deleting logged in user |
||
63 | */ |
||
64 | 2 | public function delete() |
|
72 | } |
||
73 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.