Passed
Push — master ( a981ac...5da77e )
by Tim
07:48
created
www/edit.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
     Utils\XML::checkSAMLMessage($xmldata, 'saml-meta');
47 47
     $entities = \SimpleSAML\Metadata\SAMLParser::parseDescriptorsString($xmldata);
48 48
     $entity = array_pop($entities);
49
-    $metadata =  $entity->getMetadata20SP();
49
+    $metadata = $entity->getMetadata20SP();
50 50
 
51 51
     /* Trim metadata endpoint arrays. */
52 52
     $metadata['AssertionConsumerService'] = [
Please login to merge, or discard this patch.
lib/MetaEditor.php 1 patch
Spacing   +32 added lines, -33 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
      */
20 20
     protected function getStandardField(array $request, array &$metadata, string $key): void
21 21
     {
22
-        if (array_key_exists('field_' . $key, $request)) {
23
-            $metadata[$key] = $request['field_' . $key];
22
+        if (array_key_exists('field_'.$key, $request)) {
23
+            $metadata[$key] = $request['field_'.$key];
24 24
         } elseif (isset($metadata[$key])) {
25 25
             unset($metadata[$key]);
26 26
         }
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
         string $binding,
42 42
         bool $indexed
43 43
     ): void {
44
-        if (array_key_exists('field_' . $key, $request)) {
44
+        if (array_key_exists('field_'.$key, $request)) {
45 45
             $e = [
46 46
                 'Binding' => $binding,
47
-                'Location' => $request['field_' . $key]
47
+                'Location' => $request['field_'.$key]
48 48
             ];
49 49
             if ($indexed) {
50 50
                 $e['index'] = 0;
@@ -86,11 +86,11 @@  discard block
 block discarded – undo
86 86
      */
87 87
     protected function requireStandardField(array $request, string $key): void
88 88
     {
89
-        if (!array_key_exists('field_' . $key, $request)) {
90
-            throw new Exception('Required field [' . $key . '] was missing.');
89
+        if (!array_key_exists('field_'.$key, $request)) {
90
+            throw new Exception('Required field ['.$key.'] was missing.');
91 91
         }
92
-        if (empty($request['field_' . $key])) {
93
-            throw new Exception('Required field [' . $key . '] was empty.');
92
+        if (empty($request['field_'.$key])) {
93
+            throw new Exception('Required field ['.$key.'] was empty.');
94 94
         }
95 95
     }
96 96
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      */
112 112
     protected function header(string $name): string
113 113
     {
114
-        return '<tr ><td>&nbsp;</td><td class="header">' . $name . '</td></tr>';
114
+        return '<tr ><td>&nbsp;</td><td class="header">'.$name.'</td></tr>';
115 115
     }
116 116
 
117 117
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         if (array_key_exists($key, $metadata)) {
128 128
             $value = date('j. F Y, G:i', $metadata[$key]);
129 129
         }
130
-        return '<tr><td class="name">' . $name . '</td><td class="data">' . $value . '</td></tr>';
130
+        return '<tr><td class="name">'.$name.'</td><td class="data">'.$value.'</td></tr>';
131 131
     }
132 132
 
133 133
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         if (array_key_exists($key, $metadata)) {
144 144
             $value = $metadata[$key];
145 145
         }
146
-        return '<tr><td class="name">' . $name . '</td><td class="data">' . htmlspecialchars($value) . '</td></tr>';
146
+        return '<tr><td class="name">'.$name.'</td><td class="data">'.htmlspecialchars($value).'</td></tr>';
147 147
     }
148 148
 
149 149
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      */
155 155
     protected function hiddenField(string $key, string $value): string
156 156
     {
157
-        return '<input type="hidden" name="' . $key . '" value="' . htmlspecialchars($value) . '" />';
157
+        return '<input type="hidden" name="'.$key.'" value="'.htmlspecialchars($value).'" />';
158 158
     }
159 159
 
160 160
 
@@ -190,12 +190,12 @@  discard block
 block discarded – undo
190 190
             $value = htmlspecialchars($metadata[$key]);
191 191
         }
192 192
         if ($textarea) {
193
-            return '<tr><td class="name">' . $name . '</td><td class="data"><textarea name="field_'
194
-                . $key . '" rows="5" cols="50">' . $value . '</textarea></td></tr>';
193
+            return '<tr><td class="name">'.$name.'</td><td class="data"><textarea name="field_'
194
+                . $key.'" rows="5" cols="50">'.$value.'</textarea></td></tr>';
195 195
         } else {
196
-            return '<tr><td class="name">' . $name
196
+            return '<tr><td class="name">'.$name
197 197
                 . '</td><td class="data"><input type="text" size="60" name="field_'
198
-                . $key . '" value="' . $value . '" /></td></tr>';
198
+                . $key.'" value="'.$value.'" /></td></tr>';
199 199
         }
200 200
     }
201 201
 
@@ -219,12 +219,12 @@  discard block
 block discarded – undo
219 219
         }
220 220
 
221 221
         if ($textarea) {
222
-            return '<tr><td class="name">' . $name . '</td><td class="data"><textarea name="field_'
223
-                . $key . '" rows="5" cols="50">' . $value . '</textarea></td></tr>';
222
+            return '<tr><td class="name">'.$name.'</td><td class="data"><textarea name="field_'
223
+                . $key.'" rows="5" cols="50">'.$value.'</textarea></td></tr>';
224 224
         } else {
225
-            return '<tr><td class="name">' . $name
225
+            return '<tr><td class="name">'.$name
226 226
                 . '</td><td class="data"><input type="text" size="60" name="field_'
227
-                . $key . '" value="' . $value . '" /></td></tr>';
227
+                . $key.'" value="'.$value.'" /></td></tr>';
228 228
         }
229 229
     }
230 230
 
@@ -237,20 +237,19 @@  discard block
 block discarded – undo
237 237
     {
238 238
         $this->flattenLanguageField($metadata, 'name');
239 239
         $this->flattenLanguageField($metadata, 'description');
240
-        return '<form action="edit.php" method="post">' .
240
+        return '<form action="edit.php" method="post">'.
241 241
             (array_key_exists('entityid', $metadata) ?
242
-            $this->hiddenField('was-entityid', $metadata['entityid']) :
243
-            '') . '<div id="tabdiv"><ul><li><a href="#basic">Name and descrition</a></li>' .
244
-            '<li><a href="#saml">SAML 2.0</a></li></ul><div id="basic"><table class="formtable">' .
245
-            $this->standardField($metadata, 'entityid', 'EntityID') .
246
-            $this->standardField($metadata, 'name', 'Name of service') .
247
-            $this->standardField($metadata, 'description', 'Description of service', true) .
248
-            $this->readonlyField($metadata, 'owner', 'Owner') .
249
-            $this->readonlyDateField($metadata, 'updated', 'Last updated') .
250
-            $this->readonlyDateField($metadata, 'expire', 'Expire') .
251
-            '</table></div><div id="saml"><table class="formtable">' .
252
-            $this->endpointField($metadata, 'AssertionConsumerService', 'AssertionConsumerService endpoint') .
253
-            $this->endpointField($metadata, 'SingleLogoutService', 'SingleLogoutService endpoint') .
242
+            $this->hiddenField('was-entityid', $metadata['entityid']) : '').'<div id="tabdiv"><ul><li><a href="#basic">Name and descrition</a></li>'.
243
+            '<li><a href="#saml">SAML 2.0</a></li></ul><div id="basic"><table class="formtable">'.
244
+            $this->standardField($metadata, 'entityid', 'EntityID').
245
+            $this->standardField($metadata, 'name', 'Name of service').
246
+            $this->standardField($metadata, 'description', 'Description of service', true).
247
+            $this->readonlyField($metadata, 'owner', 'Owner').
248
+            $this->readonlyDateField($metadata, 'updated', 'Last updated').
249
+            $this->readonlyDateField($metadata, 'expire', 'Expire').
250
+            '</table></div><div id="saml"><table class="formtable">'.
251
+            $this->endpointField($metadata, 'AssertionConsumerService', 'AssertionConsumerService endpoint').
252
+            $this->endpointField($metadata, 'SingleLogoutService', 'SingleLogoutService endpoint').
254 253
             '</table></div></div><input type="submit" name="submit" value="Save" style="margin-top: 5px" /></form>';
255 254
     }
256 255
 }
Please login to merge, or discard this patch.