@@ -76,10 +76,12 @@ |
||
76 | 76 | */ |
77 | 77 | public function getUriSpace() |
78 | 78 | { |
79 | - if ($this->urispace === null) // initialize cache |
|
79 | + if ($this->urispace === null) { |
|
80 | + // initialize cache |
|
80 | 81 | { |
81 | 82 | $this->urispace = $this->resource->getLiteral('void:uriSpace')->getValue(); |
82 | 83 | } |
84 | + } |
|
83 | 85 | |
84 | 86 | return $this->urispace; |
85 | 87 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | return $lname; |
105 | 105 | } |
106 | 106 | // already a full URI |
107 | - return $this->getUriSpace() . $lname; |
|
107 | + return $this->getUriSpace().$lname; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | foreach ($conceptscheme->allLiterals($prop, null) as $val) { |
176 | 176 | $prop = (substr($prop, 0, 5) == 'dc11:') ? str_replace('dc11:', 'dc:', $prop) : $prop; |
177 | 177 | if ($val->getValue() instanceof DateTime) { |
178 | - $val = Punic\Calendar::formatDate($val->getValue(), 'full', $lang) . ' ' . Punic\Calendar::format($val->getValue(), 'HH:mm:ss', $lang); |
|
178 | + $val = Punic\Calendar::formatDate($val->getValue(), 'full', $lang).' '.Punic\Calendar::format($val->getValue(), 'HH:mm:ss', $lang); |
|
179 | 179 | } |
180 | 180 | $ret[$prop][] = $val; |
181 | 181 | } |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | } |
297 | 297 | // don't know how to parse |
298 | 298 | $rev = $parts[2]; |
299 | - $datestr = $parts[3] . ' ' . $parts[4]; |
|
299 | + $datestr = $parts[3].' '.$parts[4]; |
|
300 | 300 | |
301 | 301 | return "$datestr (r$rev)"; |
302 | 302 | } |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | * Counts the statistics of the vocabulary. |
306 | 306 | * @return Array containing the label counts |
307 | 307 | */ |
308 | - public function getStatistics($lang = '', $array=null, $group=null) |
|
308 | + public function getStatistics($lang = '', $array = null, $group = null) |
|
309 | 309 | { |
310 | 310 | $sparql = $this->getSparql(); |
311 | 311 | // find the number of concepts |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | return $this->getSparql()->queryChangeList($prop, $clang, $offset, $limit); |
627 | 627 | } |
628 | 628 | |
629 | - public function getTitle($lang=null) { |
|
629 | + public function getTitle($lang = null) { |
|
630 | 630 | return $this->config->getTitle($lang); |
631 | 631 | } |
632 | 632 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | } elseif ($parts[1] == 'data') { |
38 | 38 | $controller->data($request); |
39 | 39 | } elseif (sizeof($parts) == 2) { |
40 | - header("Location: " . $parts[1] . "/"); |
|
40 | + header("Location: ".$parts[1]."/"); |
|
41 | 41 | } else { |
42 | 42 | $vocab = $parts[1]; |
43 | 43 | try { |
@@ -93,5 +93,5 @@ discard block |
||
93 | 93 | } |
94 | 94 | } catch (Exception $e) { |
95 | 95 | header("HTTP/1.0 500 Internal Server Error"); |
96 | - echo('ERROR: ' . $e->getMessage()); |
|
96 | + echo('ERROR: '.$e->getMessage()); |
|
97 | 97 | } |
@@ -106,7 +106,7 @@ |
||
106 | 106 | |
107 | 107 | public function getRequestUri() |
108 | 108 | { |
109 | - return $this->getServerConstant('HTTP_HOST') . $this->getServerConstant('REQUEST_URI'); |
|
109 | + return $this->getServerConstant('HTTP_HOST').$this->getServerConstant('REQUEST_URI'); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
@@ -74,7 +74,9 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function getQueryParam($paramName) |
76 | 76 | { |
77 | - if (!isset($this->queryParams[$paramName])) return null; |
|
77 | + if (!isset($this->queryParams[$paramName])) { |
|
78 | + return null; |
|
79 | + } |
|
78 | 80 | $val = filter_var($this->queryParams[$paramName], FILTER_SANITIZE_STRING); |
79 | 81 | return ($val !== null ? str_replace('\\', '', $val) : null); |
80 | 82 | } |
@@ -91,7 +93,9 @@ discard block |
||
91 | 93 | |
92 | 94 | public function getQueryParamPOST($paramName) |
93 | 95 | { |
94 | - if (!isset($this->queryParamsPOST[$paramName])) return null; |
|
96 | + if (!isset($this->queryParamsPOST[$paramName])) { |
|
97 | + return null; |
|
98 | + } |
|
95 | 99 | return filter_var($this->queryParamsPOST[$paramName], FILTER_SANITIZE_STRING); |
96 | 100 | } |
97 | 101 | |
@@ -106,7 +110,9 @@ discard block |
||
106 | 110 | |
107 | 111 | public function getServerConstant($paramName) |
108 | 112 | { |
109 | - if (!isset($this->serverConstants[$paramName])) return null; |
|
113 | + if (!isset($this->serverConstants[$paramName])) { |
|
114 | + return null; |
|
115 | + } |
|
110 | 116 | return filter_var($this->serverConstants[$paramName], FILTER_SANITIZE_STRING); |
111 | 117 | } |
112 | 118 | |
@@ -239,9 +245,11 @@ discard block |
||
239 | 245 | */ |
240 | 246 | public function setVocab($vocabid) |
241 | 247 | { |
242 | - if (strpos($vocabid, ' ') !== false) // if there are multiple vocabularies just storing the string |
|
248 | + if (strpos($vocabid, ' ') !== false) { |
|
249 | + // if there are multiple vocabularies just storing the string |
|
243 | 250 | { |
244 | 251 | $this->setVocabids($vocabid); |
252 | + } |
|
245 | 253 | } else { |
246 | 254 | $this->vocab = $this->model->getVocabulary($vocabid); |
247 | 255 | } |
@@ -23,5 +23,5 @@ |
||
23 | 23 | |
24 | 24 | } catch (Exception $e) { |
25 | 25 | header("HTTP/1.0 500 Internal Server Error"); |
26 | - echo('ERROR: ' . $e->getMessage()); |
|
26 | + echo('ERROR: '.$e->getMessage()); |
|
27 | 27 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | } |
15 | 15 | require_once 'vendor/autoload.php'; |
16 | 16 | } catch (Exception $e) { |
17 | - echo "Error: " . $e->getMessage(); |
|
17 | + echo "Error: ".$e->getMessage(); |
|
18 | 18 | return; |
19 | 19 | } |
20 | 20 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | // if language code missing, redirect to guessed language |
33 | 33 | // in any case, redirect to <lang>/ |
34 | 34 | $lang = sizeof($parts) == 2 && $parts[1] !== '' ? $parts[1] : $controller->guessLanguage(); |
35 | - header("Location: " . $lang . "/"); |
|
35 | + header("Location: ".$lang."/"); |
|
36 | 36 | } else { |
37 | 37 | if (array_key_exists($parts[1], $config->getLanguages())) { // global pages |
38 | 38 | $request->setLang($parts[1]); |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | } |
62 | 62 | if (sizeof($parts) == 3) { // language code missing |
63 | 63 | $lang = $controller->guessLanguage(); |
64 | - $newurl = $controller->getBaseHref() . $vocab . "/" . $lang . "/"; |
|
65 | - header("Location: " . $newurl); |
|
64 | + $newurl = $controller->getBaseHref().$vocab."/".$lang."/"; |
|
65 | + header("Location: ".$newurl); |
|
66 | 66 | } else { |
67 | 67 | if (array_key_exists($parts[2], $config->getLanguages())) { |
68 | 68 | $lang = $parts[2]; |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | } |
104 | 104 | } else { // language code missing, redirect to some language version |
105 | 105 | $lang = $controller->guessLanguage($vocab); |
106 | - $newurl = $controller->getBaseHref() . $vocab . "/" . $lang . "/" . implode('/', array_slice($parts, 2)); |
|
106 | + $newurl = $controller->getBaseHref().$vocab."/".$lang."/".implode('/', array_slice($parts, 2)); |
|
107 | 107 | $qs = $request->getServerConstant('QUERY_STRING'); |
108 | 108 | if ($qs) { |
109 | - $newurl .= "?" . $qs; |
|
109 | + $newurl .= "?".$qs; |
|
110 | 110 | } |
111 | 111 | header("Location: $newurl"); |
112 | 112 | } |
@@ -79,10 +79,12 @@ |
||
79 | 79 | if ($sortable !== null) { |
80 | 80 | uksort($sortable, array($this, 'mycompare')); |
81 | 81 | foreach ($sortable as $prop => $vals) { |
82 | - if (is_array($prop)) // the ConceptProperty objects have their own sorting methods |
|
82 | + if (is_array($prop)) { |
|
83 | + // the ConceptProperty objects have their own sorting methods |
|
83 | 84 | { |
84 | 85 | ksort($sortable[$prop]); |
85 | 86 | } |
87 | + } |
|
86 | 88 | } |
87 | 89 | } |
88 | 90 | return $sortable; |
@@ -124,8 +124,8 @@ |
||
124 | 124 | */ |
125 | 125 | public function getEnvLang() |
126 | 126 | { |
127 | - // get language from locale, same as used by gettext, set by Controller |
|
128 | - return substr(getenv("LC_ALL"), 0, 2); // @codeCoverageIgnore |
|
127 | + // get language from locale, same as used by gettext, set by Controller |
|
128 | + return substr(getenv("LC_ALL"), 0, 2); // @codeCoverageIgnore |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | return Punic\Calendar::formatDate($val, 'short'); |
50 | 50 | } catch (Exception $e) { |
51 | 51 | trigger_error($e->getMessage(), E_USER_WARNING); |
52 | - return (string) $this->literal; |
|
52 | + return (string)$this->literal; |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | return $this->literal->getValue(); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $resources = $graph->resourcesMatching('skosxl:literalForm', $this->literal); |
81 | 81 | foreach ($resources as $xlres) { |
82 | 82 | foreach ($xlres->properties() as $prop) { |
83 | - foreach($graph->allLiterals($xlres, $prop) as $val) { |
|
83 | + foreach ($graph->allLiterals($xlres, $prop) as $val) { |
|
84 | 84 | if ($prop !== 'rdf:type') { |
85 | 85 | $ret[$prop] = $val; |
86 | 86 | } |
@@ -75,7 +75,7 @@ |
||
75 | 75 | if ($this->rest) { |
76 | 76 | return $term; |
77 | 77 | } |
78 | - return strpos($term, "*") === false ? $term . "*" : $term; // default to prefix search |
|
78 | + return strpos($term, "*") === false ? $term."*" : $term; // default to prefix search |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | public function getContentLang() |
@@ -69,8 +69,9 @@ |
||
69 | 69 | public function getSearchTerm() |
70 | 70 | { |
71 | 71 | $term = $this->request->getQueryParamRaw('q') ? $this->request->getQueryParamRaw('q') : $this->request->getQueryParamRaw('query'); |
72 | - if (!$term && $this->rest) |
|
73 | - $term = $this->request->getQueryParamRaw('label'); |
|
72 | + if (!$term && $this->rest) { |
|
73 | + $term = $this->request->getQueryParamRaw('label'); |
|
74 | + } |
|
74 | 75 | $term = trim($term); // surrounding whitespace is not considered significant |
75 | 76 | if ($this->rest) { |
76 | 77 | return $term; |
@@ -400,7 +400,9 @@ discard block |
||
400 | 400 | $hits[] = $res; |
401 | 401 | } |
402 | 402 | } |
403 | - if (sizeof($hits) > 0) return $hits; |
|
403 | + if (sizeof($hits) > 0) { |
|
404 | + return $hits; |
|
405 | + } |
|
404 | 406 | |
405 | 407 | // case 2: case-insensitive match on preferred label |
406 | 408 | foreach ($results as $res) { |
@@ -408,7 +410,9 @@ discard block |
||
408 | 410 | $hits[] = $res; |
409 | 411 | } |
410 | 412 | } |
411 | - if (sizeof($hits) > 0) return $hits; |
|
413 | + if (sizeof($hits) > 0) { |
|
414 | + return $hits; |
|
415 | + } |
|
412 | 416 | |
413 | 417 | if ($lang === null) { |
414 | 418 | // case 1A: exact match on preferred label in any language |
@@ -419,7 +423,9 @@ discard block |
||
419 | 423 | $hits[] = $res; |
420 | 424 | } |
421 | 425 | } |
422 | - if (sizeof($hits) > 0) return $hits; |
|
426 | + if (sizeof($hits) > 0) { |
|
427 | + return $hits; |
|
428 | + } |
|
423 | 429 | |
424 | 430 | // case 2A: case-insensitive match on preferred label in any language |
425 | 431 | foreach ($results as $res) { |
@@ -429,7 +435,9 @@ discard block |
||
429 | 435 | $hits[] = $res; |
430 | 436 | } |
431 | 437 | } |
432 | - if (sizeof($hits) > 0) return $hits; |
|
438 | + if (sizeof($hits) > 0) { |
|
439 | + return $hits; |
|
440 | + } |
|
433 | 441 | } |
434 | 442 | |
435 | 443 | // case 3: exact match on alternate label |
@@ -438,7 +446,9 @@ discard block |
||
438 | 446 | $hits[] = $res; |
439 | 447 | } |
440 | 448 | } |
441 | - if (sizeof($hits) > 0) return $hits; |
|
449 | + if (sizeof($hits) > 0) { |
|
450 | + return $hits; |
|
451 | + } |
|
442 | 452 | |
443 | 453 | |
444 | 454 | // case 4: case-insensitive match on alternate label |
@@ -447,7 +457,9 @@ discard block |
||
447 | 457 | $hits[] = $res; |
448 | 458 | } |
449 | 459 | } |
450 | - if (sizeof($hits) > 0) return $hits; |
|
460 | + if (sizeof($hits) > 0) { |
|
461 | + return $hits; |
|
462 | + } |
|
451 | 463 | |
452 | 464 | return $hits; |
453 | 465 | } |
@@ -575,9 +575,9 @@ discard block |
||
575 | 575 | $vocid = $request->getVocab()->getId(); |
576 | 576 | return $this->returnError('404', 'Not Found', "No download source URL known for vocabulary $vocid in language $dataLang"); |
577 | 577 | } |
578 | - } else { |
|
578 | + } else { |
|
579 | 579 | header("Location: " . $urls[$format]); |
580 | - } |
|
580 | + } |
|
581 | 581 | } |
582 | 582 | |
583 | 583 | private function returnDataResults($results, $format) { |
@@ -1100,15 +1100,15 @@ discard block |
||
1100 | 1100 | foreach($changeList as $conceptInfo) { |
1101 | 1101 | if (array_key_exists('date', $conceptInfo)) { |
1102 | 1102 | $simpleChangeList[] = array( 'uri' => $conceptInfo['uri'], |
1103 | - 'prefLabel' => $conceptInfo['prefLabel'], |
|
1104 | - 'date' => $conceptInfo['date']->format("Y-m-d\TH:i:sO") ); |
|
1103 | + 'prefLabel' => $conceptInfo['prefLabel'], |
|
1104 | + 'date' => $conceptInfo['date']->format("Y-m-d\TH:i:sO") ); |
|
1105 | 1105 | } |
1106 | 1106 | } |
1107 | 1107 | return $this->returnJson(array_merge_recursive($this->context, |
1108 | 1108 | array('@context' => array( '@language' => $request->getLang(), |
1109 | - 'prefLabel' => 'skos:prefLabel', |
|
1110 | - 'xsd' => 'http://www.w3.org/2001/XMLSchema#', |
|
1111 | - 'date' => array( '@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime') ) |
|
1109 | + 'prefLabel' => 'skos:prefLabel', |
|
1110 | + 'xsd' => 'http://www.w3.org/2001/XMLSchema#', |
|
1111 | + 'date' => array( '@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime') ) |
|
1112 | 1112 | ), |
1113 | 1113 | array('changeList' => $simpleChangeList))); |
1114 | 1114 |
@@ -25,7 +25,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | 'prefLabel' => 'skos:prefLabel', |
230 | 230 | 'title' => 'dct:title', |
231 | 231 | '@language' => $request->getLang(), |
232 | - '@base' => $this->getBaseHref() . "rest/v1/" . $vocab->getId() . "/", |
|
232 | + '@base' => $this->getBaseHref()."rest/v1/".$vocab->getId()."/", |
|
233 | 233 | ), |
234 | 234 | 'uri' => '', |
235 | 235 | 'id' => $vocab->getId(), |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | 'subTypes' => array('@id' => 'void:class', '@type' => '@id'), |
284 | 284 | 'count' => 'void:entities', |
285 | 285 | '@language' => $request->getLang(), |
286 | - '@base' => $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/", |
|
286 | + '@base' => $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/", |
|
287 | 287 | ), |
288 | 288 | 'uri' => '', |
289 | 289 | 'id' => $request->getVocab()->getId(), |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | 'language' => 'void-ext:language', |
361 | 361 | 'properties' => 'void:propertyPartition', |
362 | 362 | 'labels' => 'void:triples', |
363 | - '@base' => $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/", |
|
363 | + '@base' => $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/", |
|
364 | 364 | ), |
365 | 365 | 'uri' => '', |
366 | 366 | 'id' => $request->getVocab()->getId(), |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | $types[] = $type; |
402 | 402 | } |
403 | 403 | |
404 | - $base = $request->getVocab() ? $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/" : $this->getBaseHref() . "rest/v1/"; |
|
404 | + $base = $request->getVocab() ? $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/" : $this->getBaseHref()."rest/v1/"; |
|
405 | 405 | |
406 | 406 | $ret = array_merge_recursive($this->context, array( |
407 | 407 | '@context' => array( |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | if ($lang === null) { |
443 | 443 | // case 1A: exact match on preferred label in any language |
444 | 444 | foreach ($results as $res) { |
445 | - if (isset($res['matchedPrefLabel']) && $res['matchedPrefLabel'] == $label) { |
|
445 | + if (isset($res['matchedPrefLabel']) && $res['matchedPrefLabel'] == $label) { |
|
446 | 446 | $res['prefLabel'] = $res['matchedPrefLabel']; |
447 | 447 | unset($res['matchedPrefLabel']); |
448 | 448 | $hits[] = $res; |
@@ -564,19 +564,19 @@ discard block |
||
564 | 564 | |
565 | 565 | $format = $this->negotiateFormat(array_keys($urls), $request->getServerConstant('HTTP_ACCEPT'), $request->getQueryParam('format')); |
566 | 566 | if (!$format) { |
567 | - return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: " . implode(' ', array_keys($urls))); |
|
567 | + return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: ".implode(' ', array_keys($urls))); |
|
568 | 568 | } |
569 | 569 | if (is_array($urls[$format])) { |
570 | 570 | $arr = $urls[$format]; |
571 | 571 | $dataLang = $request->getLang(); |
572 | 572 | if (isset($arr[$dataLang])) { |
573 | - header("Location: " . $arr[$dataLang]); |
|
573 | + header("Location: ".$arr[$dataLang]); |
|
574 | 574 | } else { |
575 | 575 | $vocid = $request->getVocab()->getId(); |
576 | 576 | return $this->returnError('404', 'Not Found', "No download source URL known for vocabulary $vocid in language $dataLang"); |
577 | 577 | } |
578 | 578 | } else { |
579 | - header("Location: " . $urls[$format]); |
|
579 | + header("Location: ".$urls[$format]); |
|
580 | 580 | } |
581 | 581 | } |
582 | 582 | |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | |
640 | 640 | $format = $this->negotiateFormat(explode(' ', self::SUPPORTED_FORMATS), $request->getServerConstant('HTTP_ACCEPT'), $request->getQueryParam('format')); |
641 | 641 | if (!$format) { |
642 | - return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: " . self::SUPPORTED_FORMATS); |
|
642 | + return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: ".self::SUPPORTED_FORMATS); |
|
643 | 643 | } |
644 | 644 | |
645 | 645 | $vocid = $vocab ? $vocab->getId() : null; |
@@ -924,7 +924,7 @@ discard block |
||
924 | 924 | } |
925 | 925 | } |
926 | 926 | // if the main concept scheme was not found, set 'top' to the first 'tops' (sorted alphabetically on the URIs) |
927 | - if (! isset($results[$uri]['top'])) { |
|
927 | + if (!isset($results[$uri]['top'])) { |
|
928 | 928 | $results[$uri]['top'] = $results[$uri]['tops'][0]; |
929 | 929 | } |
930 | 930 | } else { |
@@ -1102,18 +1102,18 @@ discard block |
||
1102 | 1102 | $changeList = $request->getVocab()->getChangeList($prop, $request->getLang(), $offset, $limit); |
1103 | 1103 | |
1104 | 1104 | $simpleChangeList = array(); |
1105 | - foreach($changeList as $conceptInfo) { |
|
1105 | + foreach ($changeList as $conceptInfo) { |
|
1106 | 1106 | if (array_key_exists('date', $conceptInfo)) { |
1107 | - $simpleChangeList[] = array( 'uri' => $conceptInfo['uri'], |
|
1107 | + $simpleChangeList[] = array('uri' => $conceptInfo['uri'], |
|
1108 | 1108 | 'prefLabel' => $conceptInfo['prefLabel'], |
1109 | - 'date' => $conceptInfo['date']->format("Y-m-d\TH:i:sO") ); |
|
1109 | + 'date' => $conceptInfo['date']->format("Y-m-d\TH:i:sO")); |
|
1110 | 1110 | } |
1111 | 1111 | } |
1112 | 1112 | return $this->returnJson(array_merge_recursive($this->context, |
1113 | - array('@context' => array( '@language' => $request->getLang(), |
|
1113 | + array('@context' => array('@language' => $request->getLang(), |
|
1114 | 1114 | 'prefLabel' => 'skos:prefLabel', |
1115 | 1115 | 'xsd' => 'http://www.w3.org/2001/XMLSchema#', |
1116 | - 'date' => array( '@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime') ) |
|
1116 | + 'date' => array('@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime')) |
|
1117 | 1117 | ), |
1118 | 1118 | array('changeList' => $simpleChangeList))); |
1119 | 1119 |