Completed
Push — master ( 3ba4e2...df7e41 )
by Adeniyi
02:21
created
api/Controllers/AuthController.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     protected $auth_url;
26 26
     protected $issued_by;
27 27
 
28
-    public function __construct ()
28
+    public function __construct()
29 29
     {
30 30
         $this->loadEnv();
31 31
         $this->key        = getenv('ISSUE_KEY');
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      *
40 40
      * @return string
41 41
      */
42
-    public function getKey ()
42
+    public function getKey()
43 43
     {
44 44
         return $this->key;
45 45
     }
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      *
50 50
      * @return string
51 51
      */
52
-    public function getIssuedBy ()
52
+    public function getIssuedBy()
53 53
     {
54 54
         return $this->issued_by;
55 55
     }
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      *
60 60
      * @return string
61 61
      */
62
-    public function getAuthUrl ()
62
+    public function getAuthUrl()
63 63
     {
64 64
         return $this->auth_url;
65 65
     }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      *
70 70
      * @return string
71 71
      */
72
-    public function getTestToken ()
72
+    public function getTestToken()
73 73
     {
74 74
         return $this->test_token;
75 75
     }
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
      *
82 82
      * @return string
83 83
      */
84
-    public function authorizationEncode ($userID)
84
+    public function authorizationEncode($userID)
85 85
     {
86
-        if ( ! is_null($userID) )
86
+        if (!is_null($userID))
87 87
             $token = array(
88 88
                 "iss" => $this->getIssuedBy(),
89 89
                 "aud" => $this->getAuthUrl(),
@@ -100,12 +100,12 @@  discard block
 block discarded – undo
100 100
      *
101 101
      * @return json
102 102
      */
103
-    public function authorizationDecode ($token)
103
+    public function authorizationDecode($token)
104 104
     {
105 105
         try
106 106
         {
107 107
             return JWT::decode($token, $this->getKey(), array('HS256'));
108
-        } catch ( Exception $e) {
108
+        } catch (Exception $e) {
109 109
             throw new InvalidTokenException();
110 110
         }
111 111
     }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      *
118 118
      * @return string
119 119
      */
120
-    public function passwordEncrypt ($password)
120
+    public function passwordEncrypt($password)
121 121
     {
122 122
         $options = [
123 123
             'cost' => 11,
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
      *
134 134
      * @return bool
135 135
      */
136
-    public function passwordDecrypt ($password, $hashPassword)
136
+    public function passwordDecrypt($password, $hashPassword)
137 137
     {
138
-        if ( password_verify($password, $hashPassword) )
138
+        if (password_verify($password, $hashPassword))
139 139
         {
140 140
             return true;
141 141
         }
@@ -145,9 +145,9 @@  discard block
 block discarded – undo
145 145
     /**
146 146
      * Load .env data
147 147
      */
148
-    protected function loadEnv ()
148
+    protected function loadEnv()
149 149
     {
150
-        if ( ! getenv("APP_ENV"))
150
+        if (!getenv("APP_ENV"))
151 151
         {
152 152
             $dotenv = new Dotenv($_SERVER['DOCUMENT_ROOT']);
153 153
             $dotenv->load();
Please login to merge, or discard this patch.