1 | <?php namespace JobApis\JobsToMail\Repositories; |
||
8 | class UserRepository implements Contracts\UserRepositoryInterface |
||
9 | { |
||
10 | /** |
||
11 | * @var Token model |
||
12 | */ |
||
13 | public $tokens; |
||
14 | |||
15 | /** |
||
16 | * @var User model |
||
17 | */ |
||
18 | public $users; |
||
19 | |||
20 | /** |
||
21 | * UserRepository constructor. |
||
22 | * |
||
23 | * @param User $model |
||
|
|||
24 | */ |
||
25 | 8 | public function __construct(User $users, Token $tokens) |
|
30 | |||
31 | /** |
||
32 | * Confirms a user's email and activates their account. |
||
33 | * |
||
34 | * @param $token string |
||
35 | * |
||
36 | * @return boolean |
||
37 | */ |
||
38 | 2 | public function confirm($token = null) |
|
48 | |||
49 | /** |
||
50 | * Creates a single new user, generate a token and notify the user. |
||
51 | * |
||
52 | * @param $data array |
||
53 | * |
||
54 | * @return \JobApis\JobsToMail\Models\User |
||
55 | */ |
||
56 | 2 | public function create($data = []) |
|
64 | |||
65 | /** |
||
66 | * Creates a single new user or returns an existing one by email |
||
67 | * |
||
68 | * @param $data array |
||
69 | * |
||
70 | * @return \JobApis\JobsToMail\Models\User |
||
71 | */ |
||
72 | 3 | public function firstOrCreate($data = []) |
|
84 | |||
85 | /** |
||
86 | * Retrieves a single record by ID |
||
87 | * |
||
88 | * @param $id string |
||
89 | * @param $options array |
||
90 | * |
||
91 | * @return \JobApis\JobsToMail\Models\User |
||
92 | */ |
||
93 | 1 | public function getById($id = null, $options = []) |
|
97 | |||
98 | /** |
||
99 | * Update a single user |
||
100 | * |
||
101 | * @param $id string |
||
102 | * @param $data array |
||
103 | * |
||
104 | * @return boolean |
||
105 | */ |
||
106 | 1 | public function update($id = null, $data = []) |
|
110 | |||
111 | /** |
||
112 | * Deletes a user. |
||
113 | * |
||
114 | * @param $id string |
||
115 | * |
||
116 | * @return boolean |
||
117 | */ |
||
118 | 1 | public function unsubscribe($id = null) |
|
122 | |||
123 | /** |
||
124 | * Get Confirmation Token by token id if not expired |
||
125 | * |
||
126 | * @param string $token |
||
127 | * |
||
128 | * @return mixed |
||
129 | */ |
||
130 | 2 | private function getUnexpiredConfirmationToken($token = null, $daysToExpire = 30) |
|
138 | |||
139 | /** |
||
140 | * Generates and returns a token for a specific User Id |
||
141 | * |
||
142 | * @param null $user_id |
||
143 | * @param string $type |
||
144 | * |
||
145 | * @return Token |
||
146 | */ |
||
147 | 3 | private function generateToken($user_id = null, $type = 'confirm') |
|
154 | |||
155 | /** |
||
156 | * Generates a new confirmation token and sends it to the user |
||
157 | * |
||
158 | * @param User $user |
||
159 | * |
||
160 | * @return Token |
||
161 | */ |
||
162 | 3 | private function sendConfirmationToken(User $user) |
|
171 | } |
||
172 |
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.