1 | <?php |
||
28 | trait IdentityTrait |
||
29 | { |
||
30 | |||
31 | public static $statusActive = 1; |
||
32 | public static $statusInactive = 0; |
||
33 | public $statusAttribute = 'status'; |
||
34 | private $statusRules = []; |
||
35 | public $authKeyAttribute = 'auth_key'; |
||
36 | private $authKeyRules = []; |
||
37 | public $accessTokenAttribute = 'access_token'; |
||
38 | private $accessTokenRules = []; |
||
39 | |||
40 | /** |
||
41 | * Finds an identity by the given ID. |
||
42 | * @param string|integer $id |
||
|
|||
43 | * @return type |
||
44 | */ |
||
45 | public static function findIdentity($identity) |
||
50 | |||
51 | /** |
||
52 | * Finds an identity by the given GUID. |
||
53 | * @param string $guid |
||
54 | * @return type |
||
55 | */ |
||
56 | public static function findIdentityByGuid($guid) |
||
60 | |||
61 | /** |
||
62 | * Finds an identity by the given token. |
||
63 | * @param string $token |
||
64 | * @param type $type |
||
65 | * @return type |
||
66 | */ |
||
67 | public static function findIdentityByAccessToken($token, $type = null) |
||
72 | |||
73 | /** |
||
74 | * Get auth key. |
||
75 | * @return string|null |
||
76 | */ |
||
77 | public function getAuthKey() |
||
82 | |||
83 | /** |
||
84 | * Set auth key. |
||
85 | * @param string $key |
||
86 | * @return string |
||
87 | */ |
||
88 | public function setAuthKey($key) |
||
93 | |||
94 | /** |
||
95 | * Validate the auth key. |
||
96 | * @param string $authKey |
||
97 | * @return string |
||
98 | */ |
||
99 | public function validateAuthKey($authKey) |
||
103 | |||
104 | /** |
||
105 | * Get the rules associated with auth key attribute. |
||
106 | * @return array |
||
107 | */ |
||
108 | public function getAuthKeyRules() |
||
118 | |||
119 | /** |
||
120 | * Set the rules associated with auth key attribute. |
||
121 | * @param array $rules |
||
122 | */ |
||
123 | public function setAuthKeyRules($rules) |
||
129 | |||
130 | /** |
||
131 | * Initialize the auth key attribute. |
||
132 | * This method is ONLY used for being triggered by event. DO NOT call, |
||
133 | * override or modify it directly, unless you know the consequences. |
||
134 | * @param ModelEvent $event |
||
135 | */ |
||
136 | 60 | public function onInitAuthKey($event) |
|
142 | |||
143 | /** |
||
144 | * Get access token. |
||
145 | * @return string|null |
||
146 | */ |
||
147 | public function getAccessToken() |
||
152 | |||
153 | /** |
||
154 | * Set access token. |
||
155 | * @param string $token |
||
156 | * @return string|null |
||
157 | */ |
||
158 | public function setAccessToken($token) |
||
163 | |||
164 | /** |
||
165 | * Get the rules associated with access token attribute. |
||
166 | * @return array |
||
167 | */ |
||
168 | public function getAccessTokenRules() |
||
178 | |||
179 | /** |
||
180 | * Set the rules associated with access token attribute. |
||
181 | * @param array $rules |
||
182 | */ |
||
183 | public function setAccessTokenRules($rules) |
||
189 | |||
190 | /** |
||
191 | * Initialize the access token attribute. |
||
192 | * This method is ONLY used for being triggered by event. DO NOT call, |
||
193 | * override or modify it directly, unless you know the consequences. |
||
194 | * @param ModelEvent $event |
||
195 | */ |
||
196 | 60 | public function onInitAccessToken($event) |
|
202 | |||
203 | /** |
||
204 | * Get status. |
||
205 | * @return integer |
||
206 | */ |
||
207 | public function getStatus() |
||
212 | |||
213 | /** |
||
214 | * Set status. |
||
215 | * @param integer $status |
||
216 | * @return integer|null |
||
217 | */ |
||
218 | public function setStatus($status) |
||
223 | |||
224 | /** |
||
225 | * Get the rules associated with status attribute. |
||
226 | * @return array |
||
227 | */ |
||
228 | public function getStatusRules() |
||
238 | |||
239 | /** |
||
240 | * Set the rules associated with status attribute. |
||
241 | * @param array $rules |
||
242 | */ |
||
243 | public function setStatusRules($rules) |
||
249 | |||
250 | /** |
||
251 | * Initialize the status attribute. |
||
252 | * This method is ONLY used for being triggered by event. DO NOT call, |
||
253 | * override or modify it directly, unless you know the consequences. |
||
254 | * @param ModelEvent $event |
||
255 | */ |
||
256 | 60 | public function onInitStatusAttribute($event) |
|
264 | } |
||
265 |
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.