Passed
Push — master ( 5f2716...5ce155 )
by meta
02:53
created
publish/database/migrations/2018_05_15_152839_create_azure_apps_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('azure_apps', function (Blueprint $table) {
16
+        Schema::create('azure_apps', function(Blueprint $table) {
17 17
             // Auto increment for unique id
18 18
             $table->increments('id');
19 19
             // Some human readable name
Please login to merge, or discard this patch.
src/Controllers/ApiAuthController.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -134,8 +134,8 @@
 block discarded – undo
134 134
         }
135 135
         // Get the X509 certificate for the selected key id
136 136
         $certificate = '-----BEGIN CERTIFICATE-----'.PHP_EOL
137
-                     .$x5c.PHP_EOL
138
-                     .'-----END CERTIFICATE-----';
137
+                        .$x5c.PHP_EOL
138
+                        .'-----END CERTIFICATE-----';
139 139
         // Perform the verification and get the verified payload results
140 140
         $payload = \Firebase\JWT\JWT::decode($accessToken, $certificate, ['RS256']);
141 141
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         $app_id = $appData->azp;
101 101
         $app = \Metaclassing\EnterpriseAuth\Models\AzureApp::where('app_id', $app_id)->first();
102 102
         // If we dont have an existing app go create one
103
-        if (! $app) {
103
+        if (!$app) {
104 104
             $azureApp = [
105 105
                 'name'   => $app_id,
106 106
                 'app_id' => $app_id,
@@ -117,16 +117,16 @@  discard block
 block discarded – undo
117 117
         // Unpack our jwt to verify it is correctly formed
118 118
         $token = $this->unpackJwt($accessToken);
119 119
         // app tokens must be signed in RSA
120
-        if (! isset($token['header']['alg']) || $token['header']['alg'] != 'RS256') {
120
+        if (!isset($token['header']['alg']) || $token['header']['alg'] != 'RS256') {
121 121
             throw new \Exception('Token is not using the correct signing algorithm RS256 '.$accessToken);
122 122
         }
123 123
         // app tokens are RSA signed with a key ID in the header of the token
124
-        if (! isset($token['header']['kid'])) {
124
+        if (!isset($token['header']['kid'])) {
125 125
             throw new \Exception('Token with unknown RSA key id can not be validated '.$accessToken);
126 126
         }
127 127
         // Make sure the key id is known to our azure ad information
128 128
         $kid = $token['header']['kid'];
129
-        if (! isset($this->azureActiveDirectory->signingKeys[$kid])) {
129
+        if (!isset($this->azureActiveDirectory->signingKeys[$kid])) {
130 130
             throw new \Exception('Token signed with unknown KID '.$kid);
131 131
         }
132 132
         // get the x509 encoded cert body
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
         $roles = $user->roles()->get()->all();
204 204
         foreach ($roles as $key => $role) {
205 205
             $role->permissions = $role->abilities()->get()->all();
206
-            if (! count($role->permissions)) {
206
+            if (!count($role->permissions)) {
207 207
                 unset($roles[$key]);
208 208
             }
209 209
         }
Please login to merge, or discard this patch.