Total Complexity | 5 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 81.82% |
Changes | 0 |
1 | <?php |
||
19 | trait OtpBuildTrait |
||
20 | { |
||
21 | /** |
||
22 | * Check Authkey and mobile |
||
23 | * @param string $parameter |
||
24 | * |
||
25 | * @throws ParameterException missing parameters or return empty |
||
26 | * @return bool |
||
27 | */ |
||
28 | 20 | public function isParameterPresent($parameter) |
|
29 | { |
||
30 | 20 | if ($this->isKeyExists($parameter, $this->sendData)) { |
|
31 | 20 | if ($parameter === 'authkey') { |
|
32 | 20 | return $this->hasAuthKey($parameter); |
|
33 | } else { |
||
34 | 20 | return $this->hasMobile($parameter); |
|
35 | } |
||
36 | } else { |
||
37 | $message = "Parameter ".$parameter." missing"; |
||
38 | throw ParameterException::missinglogic($message); |
||
39 | } |
||
40 | } |
||
41 | /** |
||
42 | * Check Authkey |
||
43 | * |
||
44 | * @return bool |
||
45 | */ |
||
46 | 20 | public function checkAuthKey() |
|
47 | { |
||
48 | 20 | return $this->isParameterPresent('authkey'); |
|
49 | } |
||
50 | /** |
||
51 | * Check mobile |
||
52 | * |
||
53 | * @return bool |
||
54 | */ |
||
55 | 20 | public function checkMobile() |
|
58 | } |
||
59 | } |
||
60 |