1 | <?php |
||
10 | class Auth extends Provider |
||
11 | { |
||
12 | use SendsRegisterActions; |
||
13 | |||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | protected $loginRequiredFor = [ |
||
18 | 'logout' |
||
19 | ]; |
||
20 | |||
21 | const REGISTRATION_COMPLETE_EXPERIENCE_ID = '11:10105'; |
||
22 | |||
23 | /** |
||
24 | * Login as pinner. |
||
25 | * |
||
26 | * @param string $username |
||
27 | * @param string $password |
||
28 | * @param bool $autoLogin |
||
29 | * @return bool |
||
30 | */ |
||
31 | public function login($username, $password, $autoLogin = true) |
||
46 | |||
47 | public function logout() |
||
51 | |||
52 | /** |
||
53 | * Register a new user. |
||
54 | * |
||
55 | * @param string|Registration $email |
||
56 | * @param string $password |
||
57 | * @param string $name |
||
58 | * @param string $country @deprecated |
||
59 | * @param int $age @deprecated |
||
60 | * |
||
61 | * @return bool |
||
62 | */ |
||
63 | public function register($email, $password = null, $name = null, $country = 'GB', $age = 18) |
||
69 | |||
70 | /** |
||
71 | * Register a new business account. At first we register a basic type account. |
||
72 | * Then convert it to a business one. This is done to receive a confirmation |
||
73 | * email after registration. |
||
74 | * |
||
75 | * @param string|Registration $registrationForm |
||
76 | * @param string $password |
||
77 | * @param string $name |
||
78 | * @param string $website |
||
79 | * @return bool|mixed |
||
80 | */ |
||
81 | public function registerBusiness($registrationForm, $password, $name, $website = '') |
||
92 | |||
93 | /** |
||
94 | * Convert your account to a business one. |
||
95 | * |
||
96 | * @param string $businessName |
||
97 | * @param string $websiteUrl |
||
98 | * @return bool |
||
99 | */ |
||
100 | public function convertToBusiness($businessName, $websiteUrl = '') |
||
110 | |||
111 | /** |
||
112 | * @param string $link |
||
113 | * @return array|bool |
||
114 | */ |
||
115 | public function confirmEmail($link) |
||
119 | |||
120 | /** |
||
121 | * Validates password and login. |
||
122 | * |
||
123 | * @param string $username |
||
124 | * @param string $password |
||
125 | */ |
||
126 | protected function checkCredentials($username, $password) |
||
132 | |||
133 | /** |
||
134 | * @return bool |
||
135 | */ |
||
136 | protected function completeRegistration() |
||
143 | |||
144 | /** |
||
145 | * @param Registration $registrationForm |
||
146 | * @return bool|mixed |
||
147 | */ |
||
148 | protected function makeRegisterCall(Registration $registrationForm) |
||
160 | |||
161 | /** |
||
162 | * @param string $username |
||
163 | * @param string $password |
||
164 | * @return bool |
||
165 | */ |
||
166 | protected function processLogin($username, $password) |
||
183 | |||
184 | /** |
||
185 | * @param string $username |
||
186 | * @return bool |
||
187 | */ |
||
188 | protected function processAutoLogin($username) |
||
192 | |||
193 | /** |
||
194 | * @return array |
||
195 | */ |
||
196 | protected function getProfile() |
||
200 | |||
201 | /** |
||
202 | * @param $registrationForm |
||
203 | * @param $password |
||
204 | * @param $name |
||
205 | * @param $country |
||
206 | * @param $age |
||
207 | * @return Registration |
||
208 | */ |
||
209 | protected function fillRegistrationForm($registrationForm, $password, $name, $country, $age) |
||
216 | |||
217 | /** |
||
218 | * @param string $email |
||
219 | * @param string $password |
||
220 | * @param string $name |
||
221 | * @param string $country |
||
222 | * @param string $age |
||
223 | * @return Registration |
||
224 | */ |
||
225 | protected function getRegistrationForm($email, $password, $name, $country, $age) |
||
233 | } |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.