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