Passed
Pull Request — main (#1706)
by Osma
11:44 queued 06:07
created
src/controller/RestController.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         // wrap with JSONP callback if requested
26 26
         if (filter_input(INPUT_GET, 'callback', FILTER_SANITIZE_FULL_SPECIAL_CHARS)) {
27 27
             header("Content-type: application/javascript; charset=utf-8");
28
-            echo filter_input(INPUT_GET, 'callback', FILTER_SANITIZE_FULL_SPECIAL_CHARS, FILTER_FLAG_NO_ENCODE_QUOTES) . "(" . json_encode($data) . ");";
28
+            echo filter_input(INPUT_GET, 'callback', FILTER_SANITIZE_FULL_SPECIAL_CHARS, FILTER_FLAG_NO_ENCODE_QUOTES)."(".json_encode($data).");";
29 29
             return;
30 30
         }
31 31
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
                 'vocabularies' => 'onki:hasVocabulary',
89 89
                 'id' => 'onki:vocabularyIdentifier',
90 90
                 'uri' => '@id',
91
-                '@base' => $this->getBaseHref() . "rest/v1/vocabularies",
91
+                '@base' => $this->getBaseHref()."rest/v1/vocabularies",
92 92
             ),
93 93
             'uri' => '',
94 94
             'vocabularies' => $results,
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
         foreach ($parameters->getAdditionalFields() as $field) {
137 137
 
138 138
             // Quick-and-dirty compactification
139
-            $context[$field] = 'skos:' . $field;
139
+            $context[$field] = 'skos:'.$field;
140 140
             foreach ($results as &$result) {
141 141
                 foreach ($result as $k => $v) {
142
-                    if ($k == 'skos:' . $field) {
142
+                    if ($k == 'skos:'.$field) {
143 143
                         $result[$field] = $v;
144
-                        unset($result['skos:' . $field]);
144
+                        unset($result['skos:'.$field]);
145 145
                     }
146 146
                 }
147 147
             }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
                 'prefLabel' => 'skos:prefLabel',
233 233
                 'title' => 'dct:title',
234 234
                 '@language' => $request->getLang(),
235
-                '@base' => $this->getBaseHref() . "rest/v1/" . $vocab->getId() . "/",
235
+                '@base' => $this->getBaseHref()."rest/v1/".$vocab->getId()."/",
236 236
             ),
237 237
             'uri' => '',
238 238
             'id' => $vocab->getId(),
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
                 'subTypes' => array('@id' => 'void:class', '@type' => '@id'),
288 288
                 'count' => 'void:entities',
289 289
                 '@language' => $request->getLang(),
290
-                '@base' => $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/",
290
+                '@base' => $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/",
291 291
             ),
292 292
             'uri' => '',
293 293
             'id' => $request->getVocab()->getId(),
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
                 'language' => 'void-ext:language',
370 370
                 'properties' => 'void:propertyPartition',
371 371
                 'labels' => 'void:triples',
372
-                '@base' => $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/",
372
+                '@base' => $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/",
373 373
             ),
374 374
             'uri' => '',
375 375
             'id' => $request->getVocab()->getId(),
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
             $types[] = $type;
411 411
         }
412 412
 
413
-        $base = $request->getVocab() ? $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/" : $this->getBaseHref() . "rest/v1/";
413
+        $base = $request->getVocab() ? $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/" : $this->getBaseHref()."rest/v1/";
414 414
 
415 415
         $ret = array_merge_recursive(
416 416
             $this->context,
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
         if ($lang === null) {
458 458
             // case 1A: exact match on preferred label in any language
459 459
             foreach ($results as $res) {
460
-                if (isset($res['matchedPrefLabel']) && $res['matchedPrefLabel']  == $label) {
460
+                if (isset($res['matchedPrefLabel']) && $res['matchedPrefLabel'] == $label) {
461 461
                     $res['prefLabel'] = $res['matchedPrefLabel'];
462 462
                     unset($res['matchedPrefLabel']);
463 463
                     $hits[] = $res;
@@ -592,19 +592,19 @@  discard block
 block discarded – undo
592 592
 
593 593
         $format = $this->negotiateFormat(array_keys($urls), $request->getServerConstant('HTTP_ACCEPT'), $request->getQueryParam('format'));
594 594
         if (!$format) {
595
-            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: " . implode(' ', array_keys($urls)));
595
+            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: ".implode(' ', array_keys($urls)));
596 596
         }
597 597
         if (is_array($urls[$format])) {
598 598
             $arr = $urls[$format];
599 599
             $dataLang = $request->getLang();
600 600
             if (isset($arr[$dataLang])) {
601
-                header("Location: " . $arr[$dataLang]);
601
+                header("Location: ".$arr[$dataLang]);
602 602
             } else {
603 603
                 $vocid = $request->getVocab()->getId();
604 604
                 return $this->returnError('404', 'Not Found', "No download source URL known for vocabulary $vocid in language $dataLang");
605 605
             }
606 606
         } else {
607
-            header("Location: " . $urls[$format]);
607
+            header("Location: ".$urls[$format]);
608 608
         }
609 609
     }
610 610
 
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
 
669 669
         $format = $this->negotiateFormat(explode(' ', self::SUPPORTED_FORMATS), $request->getServerConstant('HTTP_ACCEPT'), $request->getQueryParam('format'));
670 670
         if (!$format) {
671
-            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: " . self::SUPPORTED_FORMATS);
671
+            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: ".self::SUPPORTED_FORMATS);
672 672
         }
673 673
 
674 674
         $vocid = $vocab ? $vocab->getId() : null;
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
                         }
963 963
                     }
964 964
                     // if the main concept scheme was not found, set 'top' to the first 'tops' (sorted alphabetically on the URIs)
965
-                    if (! isset($results[$uri]['top'])) {
965
+                    if (!isset($results[$uri]['top'])) {
966 966
                         $results[$uri]['top'] = $results[$uri]['tops'][0];
967 967
                     }
968 968
                 } else {
@@ -1165,10 +1165,10 @@  discard block
 block discarded – undo
1165 1165
         }
1166 1166
         return $this->returnJson(array_merge_recursive(
1167 1167
             $this->context,
1168
-            array('@context' => array( '@language' => $request->getLang(),
1168
+            array('@context' => array('@language' => $request->getLang(),
1169 1169
                                                                                      'prefLabel' => 'skos:prefLabel',
1170 1170
                                                                                      'xsd' => 'http://www.w3.org/2001/XMLSchema#',
1171
-                                                                                     'date' => array( '@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime') )
1171
+                                                                                     'date' => array('@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime'))
1172 1172
                                                         ),
1173 1173
             array('changeList' => $simpleChangeList)
1174 1174
         ));
Please login to merge, or discard this patch.