Passed
Pull Request — master (#14)
by Tim
02:26
created
lib/Controller/ConsentController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -139,12 +139,12 @@
 block discarded – undo
139 139
                 $attributeSet = $state['consent:store.attributeSet'];
140 140
 
141 141
                 $this->logger::debug(
142
-                    'Consent - saveConsent() : [' . $userId . '|' . $targetedId . '|' . $attributeSet . ']'
142
+                    'Consent - saveConsent() : ['.$userId.'|'.$targetedId.'|'.$attributeSet.']'
143 143
                 );
144 144
                 try {
145 145
                     $store->saveConsent($userId, $targetedId, $attributeSet);
146 146
                 } catch (Exception $e) {
147
-                    $this->logger::error('Consent: Error writing to storage: ' . $e->getMessage());
147
+                    $this->logger::error('Consent: Error writing to storage: '.$e->getMessage());
148 148
                 }
149 149
             }
150 150
 
Please login to merge, or discard this patch.
lib/Auth/Process/Consent.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
         if (array_key_exists('includeValues', $config)) {
98 98
             if (!is_bool($config['includeValues'])) {
99 99
                 throw new Error\Exception(
100
-                    'Consent: includeValues must be boolean. ' .
101
-                    var_export($config['includeValues'], true) . ' given.'
100
+                    'Consent: includeValues must be boolean. '.
101
+                    var_export($config['includeValues'], true).' given.'
102 102
                 );
103 103
             }
104 104
             $this->includeValues = $config['includeValues'];
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
         if (array_key_exists('checked', $config)) {
108 108
             if (!is_bool($config['checked'])) {
109 109
                 throw new Error\Exception(
110
-                    'Consent: checked must be boolean. ' .
111
-                    var_export($config['checked'], true) . ' given.'
110
+                    'Consent: checked must be boolean. '.
111
+                    var_export($config['checked'], true).' given.'
112 112
                 );
113 113
             }
114 114
             $this->checked = $config['checked'];
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
         if (array_key_exists('focus', $config)) {
118 118
             if (!in_array($config['focus'], ['yes', 'no'], true)) {
119 119
                 throw new Error\Exception(
120
-                    'Consent: focus must be a string with values `yes` or `no`. ' .
121
-                    var_export($config['focus'], true) . ' given.'
120
+                    'Consent: focus must be a string with values `yes` or `no`. '.
121
+                    var_export($config['focus'], true).' given.'
122 122
                 );
123 123
             }
124 124
             $this->focus = $config['focus'];
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
         if (array_key_exists('hiddenAttributes', $config)) {
128 128
             if (!is_array($config['hiddenAttributes'])) {
129 129
                 throw new Error\Exception(
130
-                    'Consent: hiddenAttributes must be an array. ' .
131
-                    var_export($config['hiddenAttributes'], true) . ' given.'
130
+                    'Consent: hiddenAttributes must be an array. '.
131
+                    var_export($config['hiddenAttributes'], true).' given.'
132 132
                 );
133 133
             }
134 134
             $this->hiddenAttributes = $config['hiddenAttributes'];
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
         if (array_key_exists('attributes.exclude', $config)) {
138 138
             if (!is_array($config['attributes.exclude'])) {
139 139
                 throw new Error\Exception(
140
-                    'Consent: attributes.exclude must be an array. ' .
141
-                    var_export($config['attributes.exclude'], true) . ' given.'
140
+                    'Consent: attributes.exclude must be an array. '.
141
+                    var_export($config['attributes.exclude'], true).' given.'
142 142
                 );
143 143
             }
144 144
             $this->noconsentattributes = $config['attributes.exclude'];
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
             Logger::warning("The 'noconsentattributes' option has been deprecated in favour of 'attributes.exclude'.");
147 147
             if (!is_array($config['noconsentattributes'])) {
148 148
                 throw new Error\Exception(
149
-                    'Consent: noconsentattributes must be an array. ' .
150
-                    var_export($config['noconsentattributes'], true) . ' given.'
149
+                    'Consent: noconsentattributes must be an array. '.
150
+                    var_export($config['noconsentattributes'], true).' given.'
151 151
                 );
152 152
             }
153 153
             $this->noconsentattributes = $config['noconsentattributes'];
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                 $this->store = \SimpleSAML\Module\consent\Store::parseStoreConfig($config['store']);
159 159
             } catch (Exception $e) {
160 160
                 Logger::error(
161
-                    'Consent: Could not create consent storage: ' .
161
+                    'Consent: Could not create consent storage: '.
162 162
                     $e->getMessage()
163 163
                 );
164 164
             }
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
             isset($state['Source']['consent.disable']) &&
282 282
             self::checkDisable($state['Source']['consent.disable'], $spEntityId)
283 283
         ) {
284
-            Logger::debug('Consent: Consent disabled for entity ' . $spEntityId . ' with IdP ' . $idpEntityId);
284
+            Logger::debug('Consent: Consent disabled for entity '.$spEntityId.' with IdP '.$idpEntityId);
285 285
             Stats::log('consent:disabled', $statsData);
286 286
             return;
287 287
         }
@@ -289,14 +289,14 @@  discard block
 block discarded – undo
289 289
             isset($state['Destination']['consent.disable']) &&
290 290
             self::checkDisable($state['Destination']['consent.disable'], $idpEntityId)
291 291
         ) {
292
-            Logger::debug('Consent: Consent disabled for entity ' . $spEntityId . ' with IdP ' . $idpEntityId);
292
+            Logger::debug('Consent: Consent disabled for entity '.$spEntityId.' with IdP '.$idpEntityId);
293 293
             Stats::log('consent:disabled', $statsData);
294 294
             return;
295 295
         }
296 296
 
297 297
         if ($this->store !== null) {
298
-            $source = $state['Source']['metadata-set'] . '|' . $idpEntityId;
299
-            $destination = $state['Destination']['metadata-set'] . '|' . $spEntityId;
298
+            $source = $state['Source']['metadata-set'].'|'.$idpEntityId;
299
+            $destination = $state['Destination']['metadata-set'].'|'.$spEntityId;
300 300
             $attributes = $state['Attributes'];
301 301
             Assert::keyExists(
302 302
                 $attributes,
@@ -312,16 +312,16 @@  discard block
 block discarded – undo
312 312
                 }
313 313
             }
314 314
 
315
-            Logger::debug('Consent: userid: ' . $userId);
316
-            Logger::debug('Consent: source: ' . $source);
317
-            Logger::debug('Consent: destination: ' . $destination);
315
+            Logger::debug('Consent: userid: '.$userId);
316
+            Logger::debug('Consent: source: '.$source);
317
+            Logger::debug('Consent: destination: '.$destination);
318 318
 
319 319
             $hashedUserId = self::getHashedUserID($userId, $source);
320 320
             $targetedId = self::getTargetedID($userId, $source, $destination);
321 321
             $attributeSet = self::getAttributeHash($attributes, $this->includeValues);
322 322
 
323 323
             Logger::debug(
324
-                'Consent: hasConsent() [' . $hashedUserId . '|' . $targetedId . '|' . $attributeSet . ']'
324
+                'Consent: hasConsent() ['.$hashedUserId.'|'.$targetedId.'|'.$attributeSet.']'
325 325
             );
326 326
 
327 327
             try {
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
                 $state['consent:store.destination'] = $targetedId;
341 341
                 $state['consent:store.attributeSet'] = $attributeSet;
342 342
             } catch (\Exception $e) {
343
-                Logger::error('Consent: Error reading from storage: ' . $e->getMessage());
343
+                Logger::error('Consent: Error reading from storage: '.$e->getMessage());
344 344
                 Logger::stats('Consent failed');
345 345
                 Stats::log('consent:failed', $statsData);
346 346
             }
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
      */
382 382
     public static function getHashedUserID(string $userid, string $source): string
383 383
     {
384
-        return hash('sha1', $userid . '|' . Utils\Config::getSecretSalt() . '|' . $source);
384
+        return hash('sha1', $userid.'|'.Utils\Config::getSecretSalt().'|'.$source);
385 385
     }
386 386
 
387 387
 
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
      */
397 397
     public static function getTargetedID(string $userid, string $source, string $destination): string
398 398
     {
399
-        return hash('sha1', $userid . '|' . Utils\Config::getSecretSalt() . '|' . $source . '|' . $destination);
399
+        return hash('sha1', $userid.'|'.Utils\Config::getSecretSalt().'|'.$source.'|'.$destination);
400 400
     }
401 401
 
402 402
 
Please login to merge, or discard this patch.