Passed
Pull Request — master (#14)
by Tim
01:44
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
             }
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
             isset($state['Source']['consent.disable']) &&
286 286
             self::checkDisable($state['Source']['consent.disable'], $spEntityId)
287 287
         ) {
288
-            Logger::debug('Consent: Consent disabled for entity ' . $spEntityId . ' with IdP ' . $idpEntityId);
288
+            Logger::debug('Consent: Consent disabled for entity '.$spEntityId.' with IdP '.$idpEntityId);
289 289
             Stats::log('consent:disabled', $statsData);
290 290
             return;
291 291
         }
@@ -293,15 +293,15 @@  discard block
 block discarded – undo
293 293
             isset($state['Destination']['consent.disable']) &&
294 294
             self::checkDisable($state['Destination']['consent.disable'], $idpEntityId)
295 295
         ) {
296
-            Logger::debug('Consent: Consent disabled for entity ' . $spEntityId . ' with IdP ' . $idpEntityId);
296
+            Logger::debug('Consent: Consent disabled for entity '.$spEntityId.' with IdP '.$idpEntityId);
297 297
             Stats::log('consent:disabled', $statsData);
298 298
             return;
299 299
         }
300 300
 
301 301
         if ($this->store !== null) {
302 302
             Assert::keyExists($state, 'Attributes');
303
-            $source = $state['Source']['metadata-set'] . '|' . $idpEntityId;
304
-            $destination = $state['Destination']['metadata-set'] . '|' . $spEntityId;
303
+            $source = $state['Source']['metadata-set'].'|'.$idpEntityId;
304
+            $destination = $state['Destination']['metadata-set'].'|'.$spEntityId;
305 305
             $attributes = $state['Attributes'];
306 306
 
307 307
             Assert::keyExists(
@@ -320,16 +320,16 @@  discard block
 block discarded – undo
320 320
                 }
321 321
             }
322 322
 
323
-            Logger::debug('Consent: userid: ' . $userId);
324
-            Logger::debug('Consent: source: ' . $source);
325
-            Logger::debug('Consent: destination: ' . $destination);
323
+            Logger::debug('Consent: userid: '.$userId);
324
+            Logger::debug('Consent: source: '.$source);
325
+            Logger::debug('Consent: destination: '.$destination);
326 326
 
327 327
             $hashedUserId = self::getHashedUserID($userId, $source);
328 328
             $targetedId = self::getTargetedID($userId, $source, $destination);
329 329
             $attributeSet = self::getAttributeHash($attributes, $this->includeValues);
330 330
 
331 331
             Logger::debug(
332
-                'Consent: hasConsent() [' . $hashedUserId . '|' . $targetedId . '|' . $attributeSet . ']'
332
+                'Consent: hasConsent() ['.$hashedUserId.'|'.$targetedId.'|'.$attributeSet.']'
333 333
             );
334 334
 
335 335
             try {
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
                 $state['consent:store.destination'] = $targetedId;
349 349
                 $state['consent:store.attributeSet'] = $attributeSet;
350 350
             } catch (\Exception $e) {
351
-                Logger::error('Consent: Error reading from storage: ' . $e->getMessage());
351
+                Logger::error('Consent: Error reading from storage: '.$e->getMessage());
352 352
                 Logger::stats('Consent failed');
353 353
                 Stats::log('consent:failed', $statsData);
354 354
             }
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
      */
390 390
     public static function getHashedUserID(string $userid, string $source): string
391 391
     {
392
-        return hash('sha1', $userid . '|' . Utils\Config::getSecretSalt() . '|' . $source);
392
+        return hash('sha1', $userid.'|'.Utils\Config::getSecretSalt().'|'.$source);
393 393
     }
394 394
 
395 395
 
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
      */
405 405
     public static function getTargetedID(string $userid, string $source, string $destination): string
406 406
     {
407
-        return hash('sha1', $userid . '|' . Utils\Config::getSecretSalt() . '|' . $source . '|' . $destination);
407
+        return hash('sha1', $userid.'|'.Utils\Config::getSecretSalt().'|'.$source.'|'.$destination);
408 408
     }
409 409
 
410 410
 
Please login to merge, or discard this patch.