Completed
Pull Request — master (#982)
by
unknown
01:43
created
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_STRING)) {
27 27
             header("Content-type: application/javascript; charset=utf-8");
28
-            echo filter_input(INPUT_GET, 'callback', FILTER_UNSAFE_RAW) . "(" . json_encode($data) . ");";
28
+            echo filter_input(INPUT_GET, 'callback', FILTER_UNSAFE_RAW)."(".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,
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         // convert to vocids array to support multi-vocabulary search
106 106
         $vocids = ($vocabs !== null && $vocabs !== '') ? explode(' ', $vocabs) : array();
107 107
         $vocabObjects = array();
108
-        foreach($vocids as $vocid) {
108
+        foreach ($vocids as $vocid) {
109 109
             $vocabObjects[] = $this->model->getVocabulary($vocid);
110 110
         }
111 111
         $parameters->setVocabularies($vocabObjects);
@@ -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
             }
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         if ($request->getQueryParam('labellang')) {
161 161
             $ret['@context']['@language'] = $request->getQueryParam('labellang');
162 162
         } elseif ($request->getQueryParam('lang')) {
163
-            $ret['@context']['@language'] = $request->getQueryParam('lang');;
163
+            $ret['@context']['@language'] = $request->getQueryParam('lang'); ;
164 164
         }
165 165
         return $ret;
166 166
     }
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
                 'prefLabel' => 'skos:prefLabel',
227 227
                 'title' => 'dct:title',
228 228
                 '@language' => $request->getLang(),
229
-                '@base' => $this->getBaseHref() . "rest/v1/" . $vocab->getId() . "/",
229
+                '@base' => $this->getBaseHref()."rest/v1/".$vocab->getId()."/",
230 230
             ),
231 231
             'uri' => '',
232 232
             'id' => $vocab->getId(),
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
                 'subTypes' => array('@id' => 'void:class', '@type' => '@id'),
278 278
                 'count' => 'void:entities',
279 279
                 '@language' => $request->getLang(),
280
-                '@base' => $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/",
280
+                '@base' => $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/",
281 281
             ),
282 282
             'uri' => '',
283 283
             'id' => $request->getVocab()->getId(),
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
                 'language' => 'void-ext:language',
352 352
                 'properties' => 'void:propertyPartition',
353 353
                 'labels' => 'void:triples',
354
-                '@base' => $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/",
354
+                '@base' => $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/",
355 355
             ),
356 356
             'uri' => '',
357 357
             'id' => $request->getVocab()->getId(),
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
             $types[] = $type;
389 389
         }
390 390
 
391
-        $base = $request->getVocab() ? $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/" : $this->getBaseHref() . "rest/v1/";
391
+        $base = $request->getVocab() ? $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/" : $this->getBaseHref()."rest/v1/";
392 392
 
393 393
         $ret = array_merge_recursive($this->context, array(
394 394
             '@context' => array(
@@ -548,19 +548,19 @@  discard block
 block discarded – undo
548 548
 
549 549
         $format = $this->negotiateFormat(array_keys($urls), $request->getServerConstant('HTTP_ACCEPT'), $request->getQueryParam('format'));
550 550
         if (!$format) {
551
-            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: " . implode(' ', array_keys($urls)));
551
+            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: ".implode(' ', array_keys($urls)));
552 552
         }
553 553
         if (is_array($urls[$format])) {
554 554
             $arr = $urls[$format];
555 555
             $dataLang = $request->getLang();
556 556
             if (isset($arr[$dataLang])) {
557
-                header("Location: " . $arr[$dataLang]);
557
+                header("Location: ".$arr[$dataLang]);
558 558
             } else {
559 559
                 $vocid = $request->getVocab()->getId();
560 560
                 return $this->returnError('404', 'Not Found', "No download source URL known for vocabulary $vocid in language $dataLang");
561 561
             }
562 562
 		} else {
563
-            header("Location: " . $urls[$format]);
563
+            header("Location: ".$urls[$format]);
564 564
 		}
565 565
     }
566 566
 
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
 
621 621
         $format = $this->negotiateFormat(explode(' ', self::SUPPORTED_FORMATS), $request->getServerConstant('HTTP_ACCEPT'), $request->getQueryParam('format'));
622 622
         if (!$format) {
623
-            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: " . self::SUPPORTED_FORMATS);
623
+            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: ".self::SUPPORTED_FORMATS);
624 624
         }
625 625
 
626 626
         $vocid = $vocab ? $vocab->getId() : null;
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
                         }
876 876
                     }
877 877
                     // if the main concept scheme was not found, set 'top' to the first 'tops' (sorted alphabetically on the URIs)
878
-                    if (! isset($results[$uri]['top'])) {
878
+                    if (!isset($results[$uri]['top'])) {
879 879
                         $results[$uri]['top'] = $results[$uri]['tops'][0];
880 880
                     }
881 881
                 } else {
@@ -1028,7 +1028,7 @@  discard block
 block discarded – undo
1028 1028
      * @param Request $request
1029 1029
      * @return object json-ld wrapped list of changed concepts
1030 1030
      */
1031
-    private function changed($request, $prop='dc:created')
1031
+    private function changed($request, $prop = 'dc:created')
1032 1032
     {
1033 1033
         // set language parameters for gettext
1034 1034
         //$this->setLanguageProperties($request->getLang());
Please login to merge, or discard this patch.