@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | class ProfileCertain extends CertainRessourceAbstract implements CertainRessourceInterface |
13 | 13 | { |
14 | - public function getRessourceName(){ |
|
14 | + public function getRessourceName() { |
|
15 | 15 | return 'Profile'; |
16 | 16 | } |
17 | 17 | public function getMandatoryFields() |
@@ -27,18 +27,18 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function getProfileByEmail($email) |
29 | 29 | { |
30 | - $resultCertain = $this->getProfileCertainReturnByEmail($email); |
|
31 | - if($resultCertain->isSuccessFul()){ |
|
30 | + $resultCertain = $this->getProfileCertainReturnByEmail($email); |
|
31 | + if ($resultCertain->isSuccessFul()) { |
|
32 | 32 | $resultCertainProfile = $resultCertain->getResults(); |
33 | - if($resultCertainProfile->size == 1){ |
|
33 | + if ($resultCertainProfile->size == 1) { |
|
34 | 34 | return $resultCertainProfile->profiles[0]; |
35 | 35 | |
36 | - } elseif($resultCertainProfile->size > 1){ |
|
36 | + } elseif ($resultCertainProfile->size>1) { |
|
37 | 37 | throw new RessourceException('Duplicate entries'); |
38 | - } else{ |
|
38 | + }else { |
|
39 | 39 | return $resultCertain; |
40 | 40 | } |
41 | - } else{ |
|
41 | + }else { |
|
42 | 42 | return null; |
43 | 43 | } |
44 | 44 | |
@@ -50,17 +50,17 @@ discard block |
||
50 | 50 | * @param string $email |
51 | 51 | * @return ProfileObject |
52 | 52 | */ |
53 | - public function getDuplicateProfileByEmail($profilePin,$email) |
|
53 | + public function getDuplicateProfileByEmail($profilePin, $email) |
|
54 | 54 | { |
55 | - $resultCertain = $this->get(null, [ |
|
55 | + $resultCertain = $this->get(null, [ |
|
56 | 56 | 'email'=> $email |
57 | 57 | ]); |
58 | - if($resultCertain->isSuccessFul() && $resultCertain->getResults()->size <= 1){ |
|
58 | + if ($resultCertain->isSuccessFul() && $resultCertain->getResults()->size<=1) { |
|
59 | 59 | return null; |
60 | 60 | } |
61 | 61 | $profilesCertain = $resultCertain->getResults()->profiles; |
62 | 62 | $pofileDuplicates = array_map(function($profile) use ($profilePin){ |
63 | - if($profile->profilePin != $profilePin){ |
|
63 | + if ($profile->profilePin != $profilePin) { |
|
64 | 64 | return $profile; |
65 | 65 | } |
66 | 66 | }, $profilesCertain); |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function getProfiles() |
87 | 87 | { |
88 | - $request= $this->get(); |
|
89 | - if($request->isSuccessFul()){ |
|
88 | + $request = $this->get(); |
|
89 | + if ($request->isSuccessFul()) { |
|
90 | 90 | $profileCertainResults = $request->getResults(); |
91 | 91 | return $profileCertainResults->profiles; |
92 | 92 | } |