| @@ -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 | } | 
| @@ -64,7 +64,7 @@ discard block | ||
| 64 | 64 | * | 
| 65 | 65 | * @param string $query | 
| 66 | 66 | * @return string | 
| 67 | - */ | |
| 67 | + */ | |
| 68 | 68 | protected function generateQueryPrefixes($query) | 
| 69 | 69 |      { | 
| 70 | 70 | // Check for undefined prefixes | 
| @@ -1016,7 +1016,7 @@ discard block | ||
| 1016 | 1016 | return $query; | 
| 1017 | 1017 | } | 
| 1018 | 1018 | /** | 
| 1019 | - * This function can be overwritten in other SPARQL dialects for the possibility of handling the different language clauses | |
| 1019 | + * This function can be overwritten in other SPARQL dialects for the possibility of handling the different language clauses | |
| 1020 | 1020 | * @param string $lang | 
| 1021 | 1021 | * @return string formatted language clause | 
| 1022 | 1022 | */ | 
| @@ -88,7 +88,7 @@ discard block | ||
| 88 | 88 |      { | 
| 89 | 89 |          $queryId = sprintf("%05d", rand(0, 99999)); | 
| 90 | 90 | $logger = $this->model->getLogger(); | 
| 91 | -        $logger->info("[qid $queryId] SPARQL query:\n" . $this->generateQueryPrefixes($query) . "\n$query\n"); | |
| 91 | +        $logger->info("[qid $queryId] SPARQL query:\n".$this->generateQueryPrefixes($query)."\n$query\n"); | |
| 92 | 92 | $starttime = microtime(true); | 
| 93 | 93 | $result = $this->client->query($query); | 
| 94 | 94 | $elapsed = intval(round((microtime(true) - $starttime) * 1000)); | 
| @@ -257,9 +257,9 @@ discard block | ||
| 257 | 257 | $gcl = $this->graphClause; | 
| 258 | 258 |          $classes = ($classes) ? $classes : array('http://www.w3.org/2004/02/skos/core#Concept'); | 
| 259 | 259 | |
| 260 | -        $quote_string = function ($val) { return "'$val'"; }; | |
| 260 | +        $quote_string = function($val) { return "'$val'"; }; | |
| 261 | 261 | $quoted_values = array_map($quote_string, $langs); | 
| 262 | -        $langFilter = "FILTER(?lang IN (" . implode(',', $quoted_values) . "))"; | |
| 262 | +        $langFilter = "FILTER(?lang IN (".implode(',', $quoted_values)."))"; | |
| 263 | 263 | |
| 264 | 264 |          $values = $this->formatValues('?type', $classes, 'uri'); | 
| 265 | 265 |          $valuesProp = $this->formatValues('?prop', $props, null); | 
| @@ -791,7 +791,7 @@ discard block | ||
| 791 | 791 | $values[] = "<$graph>"; | 
| 792 | 792 | } | 
| 793 | 793 |          if (count($values)) { | 
| 794 | -            return "FILTER (?graph IN (" . implode(',', $values) . "))"; | |
| 794 | +            return "FILTER (?graph IN (".implode(',', $values)."))"; | |
| 795 | 795 | } | 
| 796 | 796 | } | 
| 797 | 797 | |
| @@ -803,16 +803,16 @@ discard block | ||
| 803 | 803 | */ | 
| 804 | 804 | protected function formatLimitAndOffset($limit, $offset) | 
| 805 | 805 |      { | 
| 806 | - $limit = ($limit) ? 'LIMIT ' . $limit : ''; | |
| 807 | - $offset = ($offset) ? 'OFFSET ' . $offset : ''; | |
| 806 | + $limit = ($limit) ? 'LIMIT '.$limit : ''; | |
| 807 | + $offset = ($offset) ? 'OFFSET '.$offset : ''; | |
| 808 | 808 | // eliminating whitespace and line changes when the conditions aren't needed. | 
| 809 | 809 | $limitandoffset = ''; | 
| 810 | 810 |          if ($limit && $offset) { | 
| 811 | - $limitandoffset = "\n" . $limit . "\n" . $offset; | |
| 811 | + $limitandoffset = "\n".$limit."\n".$offset; | |
| 812 | 812 |          } elseif ($limit) { | 
| 813 | - $limitandoffset = "\n" . $limit; | |
| 813 | + $limitandoffset = "\n".$limit; | |
| 814 | 814 |          } elseif ($offset) { | 
| 815 | - $limitandoffset = "\n" . $offset; | |
| 815 | + $limitandoffset = "\n".$offset; | |
| 816 | 816 | } | 
| 817 | 817 | |
| 818 | 818 | return $limitandoffset; | 
| @@ -968,14 +968,14 @@ discard block | ||
| 968 | 968 | // if search language and UI/display language differ, must also consider case where there is no prefLabel in | 
| 969 | 969 | // the display language; in that case, should use the label with the same language as the matched label | 
| 970 | 970 | $labelcondFallback = ($searchLang != $lang) ? | 
| 971 | -          "OPTIONAL { # in case previous OPTIONAL block gives no labels\n" . | |
| 971 | +          "OPTIONAL { # in case previous OPTIONAL block gives no labels\n". | |
| 972 | 972 | "?s skos:prefLabel ?label . FILTER (LANGMATCHES(LANG(?label), LANG(?match))) }" : ""; | 
| 973 | 973 | |
| 974 | 974 | // Including the labels if there is no query term given. | 
| 975 | 975 |          if ($rawterm === '') { | 
| 976 | 976 | $labelClause = "?s skos:prefLabel ?label ."; | 
| 977 | - $labelClause = ($lang) ? $labelClause . " FILTER (LANGMATCHES(LANG(?label), '$lang'))" : $labelClause . ""; | |
| 978 | - return $labelClause . " BIND(?label AS ?match)"; | |
| 977 | + $labelClause = ($lang) ? $labelClause." FILTER (LANGMATCHES(LANG(?label), '$lang'))" : $labelClause.""; | |
| 978 | + return $labelClause." BIND(?label AS ?match)"; | |
| 979 | 979 | } | 
| 980 | 980 | |
| 981 | 981 | /* | 
| @@ -1059,9 +1059,9 @@ discard block | ||
| 1059 | 1059 |              $filterDeprecated = "FILTER NOT EXISTS { ?s owl:deprecated true }"; | 
| 1060 | 1060 | } | 
| 1061 | 1061 | // extra conditions for parent and group, if specified | 
| 1062 | - $parentcond = ($params->getParentLimit()) ? "?s skos:broader+ <" . $params->getParentLimit() . "> ." : ""; | |
| 1063 | - $groupcond = ($params->getGroupLimit()) ? "<" . $params->getGroupLimit() . "> skos:member ?s ." : ""; | |
| 1064 | - $pgcond = $parentcond . $groupcond; | |
| 1062 | + $parentcond = ($params->getParentLimit()) ? "?s skos:broader+ <".$params->getParentLimit()."> ." : ""; | |
| 1063 | + $groupcond = ($params->getGroupLimit()) ? "<".$params->getGroupLimit()."> skos:member ?s ." : ""; | |
| 1064 | + $pgcond = $parentcond.$groupcond; | |
| 1065 | 1065 | |
| 1066 | 1066 | $orderextra = $this->isDefaultEndpoint() ? $this->graph : ''; | 
| 1067 | 1067 | |
| @@ -1149,7 +1149,7 @@ discard block | ||
| 1149 | 1149 | |
| 1150 | 1150 |          if (!empty($fields)) { | 
| 1151 | 1151 |              foreach ($fields as $prop) { | 
| 1152 | - $propname = $prop . 's'; | |
| 1152 | + $propname = $prop.'s'; | |
| 1153 | 1153 |                  if (isset($row->$propname)) { | 
| 1154 | 1154 |                      foreach (explode("\n", $row->$propname->getValue()) as $line) { | 
| 1155 | 1155 | $rdata = str_getcsv($line, ',', '"', '"'); | 
| @@ -1164,7 +1164,7 @@ discard block | ||
| 1164 | 1164 | $propvals = $rdata[2]; | 
| 1165 | 1165 | } | 
| 1166 | 1166 | |
| 1167 | - $hit['skos:' . $prop][] = $propvals; | |
| 1167 | + $hit['skos:'.$prop][] = $propvals; | |
| 1168 | 1168 | } | 
| 1169 | 1169 | } | 
| 1170 | 1170 | } | 
| @@ -1299,7 +1299,7 @@ discard block | ||
| 1299 | 1299 | $conditions = $this->formatFilterConditions($letter, $lang); | 
| 1300 | 1300 | $filtercondLabel = $conditions['filterpref']; | 
| 1301 | 1301 | $filtercondALabel = $conditions['filteralt']; | 
| 1302 | -        $qualifierClause = $qualifier ? "OPTIONAL { ?s <" . $qualifier->getURI() . "> ?qualifier }" : ""; | |
| 1302 | +        $qualifierClause = $qualifier ? "OPTIONAL { ?s <".$qualifier->getURI()."> ?qualifier }" : ""; | |
| 1303 | 1303 | $filterDeprecated = ""; | 
| 1304 | 1304 |          if (!$showDeprecated) { | 
| 1305 | 1305 |              $filterDeprecated = "FILTER NOT EXISTS { ?s owl:deprecated true }"; | 
| @@ -1796,7 +1796,7 @@ discard block | ||
| 1796 | 1796 |                  if (!isset($row->label) || $row->label->getLang() === $lang) { | 
| 1797 | 1797 | $ret[$row->object->getUri()] = $val; | 
| 1798 | 1798 |                  } elseif ($row->label->getLang() === $fallbacklang) { | 
| 1799 | -                    $val['label'] .= ' (' . $row->label->getLang() . ')'; | |
| 1799 | +                    $val['label'] .= ' ('.$row->label->getLang().')'; | |
| 1800 | 1800 | $ret[$row->object->getUri()] = $val; | 
| 1801 | 1801 | } | 
| 1802 | 1802 | } | 
| @@ -1895,10 +1895,10 @@ discard block | ||
| 1895 | 1895 | |
| 1896 | 1896 | $label = null; | 
| 1897 | 1897 |              if (isset($row->label)) { | 
| 1898 | -                if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang . "-") == 0) { | |
| 1898 | +                if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang."-") == 0) { | |
| 1899 | 1899 | $label = $row->label->getValue(); | 
| 1900 | 1900 |                  } else { | 
| 1901 | -                    $label = $row->label->getValue() . " (" . $row->label->getLang() . ")"; | |
| 1901 | +                    $label = $row->label->getValue()." (".$row->label->getLang().")"; | |
| 1902 | 1902 | } | 
| 1903 | 1903 | |
| 1904 | 1904 | } | 
| @@ -1976,8 +1976,8 @@ discard block | ||
| 1976 | 1976 |          foreach ($result as $row) { | 
| 1977 | 1977 |              if (isset($row->top) && isset($row->label)) { | 
| 1978 | 1978 | $label = $row->label->getValue(); | 
| 1979 | -                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang . "-") !== 0) { | |
| 1980 | -                    $label .= ' (' . $row->label->getLang() . ')'; | |
| 1979 | +                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang."-") !== 0) { | |
| 1980 | +                    $label .= ' ('.$row->label->getLang().')'; | |
| 1981 | 1981 | } | 
| 1982 | 1982 |                  $top = array('uri' => $row->top->getUri(), 'topConceptOf' => $row->topuri->getUri(), 'label' => $label, 'hasChildren' => filter_var($row->children->getValue(), FILTER_VALIDATE_BOOLEAN)); | 
| 1983 | 1983 |                  if (isset($row->notation)) { | 
| @@ -2084,8 +2084,8 @@ discard block | ||
| 2084 | 2084 | $label = null; | 
| 2085 | 2085 |                  if (isset($row->childlabel)) { | 
| 2086 | 2086 | $label = $row->childlabel->getValue(); | 
| 2087 | -                    if ($row->childlabel->getLang() !== $lang && strpos($row->childlabel->getLang(), $lang . "-") !== 0) { | |
| 2088 | -                        $label .= " (" . $row->childlabel->getLang() . ")"; | |
| 2087 | +                    if ($row->childlabel->getLang() !== $lang && strpos($row->childlabel->getLang(), $lang."-") !== 0) { | |
| 2088 | +                        $label .= " (".$row->childlabel->getLang().")"; | |
| 2089 | 2089 | } | 
| 2090 | 2090 | |
| 2091 | 2091 | } | 
| @@ -2106,8 +2106,8 @@ discard block | ||
| 2106 | 2106 | } | 
| 2107 | 2107 |              if (isset($row->label)) { | 
| 2108 | 2108 | $preflabel = $row->label->getValue(); | 
| 2109 | -                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang . "-") !== 0) { | |
| 2110 | -                    $preflabel .= ' (' . $row->label->getLang() . ')'; | |
| 2109 | +                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang."-") !== 0) { | |
| 2110 | +                    $preflabel .= ' ('.$row->label->getLang().')'; | |
| 2111 | 2111 | } | 
| 2112 | 2112 | |
| 2113 | 2113 | $ret[$uri]['prefLabel'] = $preflabel; | 
| @@ -2274,10 +2274,10 @@ discard block | ||
| 2274 | 2274 | 'type' => array($row->type->shorten()), | 
| 2275 | 2275 | ); | 
| 2276 | 2276 |                  if (isset($row->label)) { | 
| 2277 | -                    if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang . "-") == 0) { | |
| 2277 | +                    if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang."-") == 0) { | |
| 2278 | 2278 | $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue(); | 
| 2279 | 2279 |                      } else { | 
| 2280 | -                        $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue() . " (" . $row->label->getLang() . ")"; | |
| 2280 | +                        $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue()." (".$row->label->getLang().")"; | |
| 2281 | 2281 | } | 
| 2282 | 2282 | |
| 2283 | 2283 | } | 
| @@ -2324,7 +2324,7 @@ discard block | ||
| 2324 | 2324 | private function generateChangeListQuery($prop, $lang, $offset, $limit = 200, $showDeprecated = false) | 
| 2325 | 2325 |      { | 
| 2326 | 2326 | $fcl = $this->generateFromClause(); | 
| 2327 | - $offset = ($offset) ? 'OFFSET ' . $offset : ''; | |
| 2327 | + $offset = ($offset) ? 'OFFSET '.$offset : ''; | |
| 2328 | 2328 | |
| 2329 | 2329 | //Additional clauses when deprecated concepts need to be included in the results | 
| 2330 | 2330 | $deprecatedOptions = ''; | 
| @@ -52,7 +52,7 @@ discard block | ||
| 52 | 52 | return isset($results[$lang]) ? $results[$lang] : null; | 
| 53 | 53 |              } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) { | 
| 54 | 54 |                  if ($this->model->getConfig()->getLogCaughtExceptions()) { | 
| 55 | -                    error_log('Caught exception: ' . $e->getMessage()); | |
| 55 | +                    error_log('Caught exception: '.$e->getMessage()); | |
| 56 | 56 | } | 
| 57 | 57 | } | 
| 58 | 58 | } | 
| @@ -74,7 +74,7 @@ discard block | ||
| 74 | 74 | return isset($results) ? $results : null; | 
| 75 | 75 |              } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) { | 
| 76 | 76 |                  if ($this->model->getConfig()->getLogCaughtExceptions()) { | 
| 77 | -                    error_log('Caught exception: ' . $e->getMessage()); | |
| 77 | +                    error_log('Caught exception: '.$e->getMessage()); | |
| 78 | 78 | } | 
| 79 | 79 | } | 
| 80 | 80 | } | 
| @@ -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() | 
| @@ -33,16 +33,16 @@ | ||
| 33 | 33 | // Encrypt the current time | 
| 34 | 34 | $honey_time_encrypted = $this->getEncryptedTime(); | 
| 35 | 35 | return '<div id="' . $honey_name . '_wrap" style="display:none;">' . "\r\n" . | 
| 36 | - '<input name="' . $honey_name . '" type="text" value="" id="' . $honey_name . '"/>' . "\r\n" . | |
| 37 | - '<input name="' . $honey_time . '" type="text" value="' . $honey_time_encrypted . '"/>' . "\r\n" . | |
| 36 | + '<input name="' . $honey_name . '" type="text" value="" id="' . $honey_name . '"/>' . "\r\n" . | |
| 37 | + '<input name="' . $honey_time . '" type="text" value="' . $honey_time_encrypted . '"/>' . "\r\n" . | |
| 38 | 38 | '</div>'; | 
| 39 | 39 | } | 
| 40 | 40 | /** | 
| 41 | - * Validate honeypot is empty | |
| 42 | - * | |
| 43 | - * @param mixed $value | |
| 44 | - * @return boolean | |
| 45 | - */ | |
| 41 | + * Validate honeypot is empty | |
| 42 | + * | |
| 43 | + * @param mixed $value | |
| 44 | + * @return boolean | |
| 45 | + */ | |
| 46 | 46 | public function validateHoneypot($value): bool | 
| 47 | 47 |      { | 
| 48 | 48 |          if ($this->disabled) { | 
| @@ -32,9 +32,9 @@ | ||
| 32 | 32 |      { | 
| 33 | 33 | // Encrypt the current time | 
| 34 | 34 | $honey_time_encrypted = $this->getEncryptedTime(); | 
| 35 | - return '<div id="' . $honey_name . '_wrap" style="display:none;">' . "\r\n" . | |
| 36 | - '<input name="' . $honey_name . '" type="text" value="" id="' . $honey_name . '"/>' . "\r\n" . | |
| 37 | - '<input name="' . $honey_time . '" type="text" value="' . $honey_time_encrypted . '"/>' . "\r\n" . | |
| 35 | + return '<div id="'.$honey_name.'_wrap" style="display:none;">'."\r\n". | |
| 36 | + '<input name="'.$honey_name.'" type="text" value="" id="'.$honey_name.'"/>'."\r\n". | |
| 37 | + '<input name="'.$honey_time.'" type="text" value="'.$honey_time_encrypted.'"/>'."\r\n". | |
| 38 | 38 | '</div>'; | 
| 39 | 39 | } | 
| 40 | 40 | /** | 
| @@ -1165,9 +1165,9 @@ | ||
| 1165 | 1165 | return $this->returnJson(array_merge_recursive( | 
| 1166 | 1166 | $this->context, | 
| 1167 | 1167 |              array('@context' => array( '@language' => $request->getLang(), | 
| 1168 | - 'prefLabel' => 'skos:prefLabel', | |
| 1169 | - 'xsd' => 'http://www.w3.org/2001/XMLSchema#', | |
| 1170 | - 'date' => array( '@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime') ) | |
| 1168 | + 'prefLabel' => 'skos:prefLabel', | |
| 1169 | + 'xsd' => 'http://www.w3.org/2001/XMLSchema#', | |
| 1170 | + 'date' => array( '@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime') ) | |
| 1171 | 1171 | ), | 
| 1172 | 1172 |              array('changeList' => $simpleChangeList) | 
| 1173 | 1173 | )); | 
| @@ -25,7 +25,7 @@ discard block | ||
| 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) . "(" . json_encode($data) . ");"; | |
| 28 | +            echo filter_input(INPUT_GET, 'callback', FILTER_SANITIZE_FULL_SPECIAL_CHARS)."(".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, | 
| @@ -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 | } | 
| @@ -232,7 +232,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | )); | 
| @@ -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 | } | 
| @@ -36,7 +36,7 @@ discard block | ||
| 36 | 36 |      { | 
| 37 | 37 | $label = $this->getLabel(); | 
| 38 | 38 | $notation = $this->getNotation(); | 
| 39 | - return ltrim($notation . ' ') . $label; | |
| 39 | + return ltrim($notation.' ').$label; | |
| 40 | 40 | } | 
| 41 | 41 | |
| 42 | 42 | public function getType() | 
| @@ -57,7 +57,7 @@ discard block | ||
| 57 | 57 | |
| 58 | 58 | public function getSortKey() | 
| 59 | 59 |      { | 
| 60 | - return strtolower($this->getVocabName() . ": " . $this->getLabel()); | |
| 60 | + return strtolower($this->getVocabName().": ".$this->getLabel()); | |
| 61 | 61 | } | 
| 62 | 62 | |
| 63 | 63 | private function queryLabel($lang = '', $queryExVocabs = true) | 
| @@ -186,25 +186,25 @@ discard block | ||
| 186 | 186 | 'from' => [ | 
| 187 | 187 | 'memberSet' => [ | 
| 188 | 188 | [ | 
| 189 | - 'uri' => (string) $this->source->getUri(), | |
| 189 | + 'uri' => (string)$this->source->getUri(), | |
| 190 | 190 | ] | 
| 191 | 191 | ] | 
| 192 | 192 | ], | 
| 193 | 193 | 'to' => [ | 
| 194 | 194 | 'memberSet' => [ | 
| 195 | 195 | [ | 
| 196 | - 'uri' => (string) $this->getUri() | |
| 196 | + 'uri' => (string)$this->getUri() | |
| 197 | 197 | ] | 
| 198 | 198 | ] | 
| 199 | 199 | ], | 
| 200 | 200 | // EXTRA | 
| 201 | 201 | 'hrefLink' => $hrefLink, // link to resource as displayed in the UI | 
| 202 | 202 | 'lang' => $propertyLang, // TBD: could it be part of the prefLabel? | 
| 203 | - 'vocabName' => (string) $this->getVocabName(), // vocabulary as displayed in the UI | |
| 203 | + 'vocabName' => (string)$this->getVocabName(), // vocabulary as displayed in the UI | |
| 204 | 204 | 'typeLabel' => $this->model->getText($this->type), // a text used in the UI instead of, for example, skos:closeMatch | 
| 205 | 205 | ]; | 
| 206 | 206 | |
| 207 | - $helpprop = $this->type . "_help"; | |
| 207 | + $helpprop = $this->type."_help"; | |
| 208 | 208 | // see if we have a translation for the property help text | 
| 209 | 209 | $help = $this->model->getText($helpprop); | 
| 210 | 210 |          if ($help != $helpprop) { | 
| @@ -214,20 +214,20 @@ discard block | ||
| 214 | 214 | $fromScheme = $this->vocab->getDefaultConceptScheme(); | 
| 215 | 215 |          if (isset($fromScheme)) { | 
| 216 | 216 | $ret['fromScheme'] = [ | 
| 217 | - 'uri' => (string) $fromScheme, | |
| 217 | + 'uri' => (string)$fromScheme, | |
| 218 | 218 | ]; | 
| 219 | 219 | } | 
| 220 | 220 | |
| 221 | 221 | $exvocab = $this->getExvocab(); | 
| 222 | 222 |          if (isset($exvocab)) { | 
| 223 | 223 | $ret['toScheme'] = [ | 
| 224 | - 'uri' => (string) $exvocab->getDefaultConceptScheme(), | |
| 224 | + 'uri' => (string)$exvocab->getDefaultConceptScheme(), | |
| 225 | 225 | ]; | 
| 226 | 226 | } | 
| 227 | 227 | |
| 228 | 228 | $notation = $this->getNotation(); | 
| 229 | 229 |          if (isset($notation)) { | 
| 230 | - $ret['to']['memberSet'][0]['notation'] = (string) $notation; | |
| 230 | + $ret['to']['memberSet'][0]['notation'] = (string)$notation; | |
| 231 | 231 | } | 
| 232 | 232 | |
| 233 | 233 | $label = $this->getLabel($lang, $queryExVocabs); | 
| @@ -9,7 +9,7 @@ discard block | ||
| 9 | 9 | } | 
| 10 | 10 | require_once '../vendor/autoload.php'; | 
| 11 | 11 |  } catch (Exception $e) { | 
| 12 | - echo "Error: " . $e->getMessage(); | |
| 12 | + echo "Error: ".$e->getMessage(); | |
| 13 | 13 | return; | 
| 14 | 14 | } | 
| 15 | 15 | |
| @@ -17,7 +17,7 @@ discard block | ||
| 17 | 17 | $model = new Model(); | 
| 18 | 18 |  } catch (Exception $e) { | 
| 19 | 19 |      header("HTTP/1.1 500 Internal Server Error"); | 
| 20 | - echo "Error: " . $e->getMessage(); | |
| 20 | + echo "Error: ".$e->getMessage(); | |
| 21 | 21 | exit(1); | 
| 22 | 22 | } | 
| 23 | 23 | |
| @@ -33,7 +33,7 @@ discard block | ||
| 33 | 33 | // if language code missing, redirect to guessed language | 
| 34 | 34 | // in any case, redirect to <lang>/ | 
| 35 | 35 | $lang = sizeof($parts) == 2 && $parts[1] !== '' ? $parts[1] : $controller->guessLanguage($request); | 
| 36 | -    header("Location: " . $lang . "/"); | |
| 36 | +    header("Location: ".$lang."/"); | |
| 37 | 37 |  } else { | 
| 38 | 38 |      if (array_key_exists($parts[1], $model->getConfig()->getLanguages())) { // global pages | 
| 39 | 39 | $request->setLang($parts[1]); | 
| @@ -63,8 +63,8 @@ discard block | ||
| 63 | 63 | } | 
| 64 | 64 |          if (sizeof($parts) == 3) { // language code missing | 
| 65 | 65 | $lang = $controller->guessLanguage($request); | 
| 66 | - $newurl = $controller->getBaseHref() . $vocab . "/" . $lang . "/"; | |
| 67 | -            header("Location: " . $newurl); | |
| 66 | + $newurl = $controller->getBaseHref().$vocab."/".$lang."/"; | |
| 67 | +            header("Location: ".$newurl); | |
| 68 | 68 |          } else { | 
| 69 | 69 |              if (array_key_exists($parts[2], $model->getConfig()->getLanguages())) { | 
| 70 | 70 | $lang = $parts[2]; | 
| @@ -105,10 +105,10 @@ discard block | ||
| 105 | 105 | } | 
| 106 | 106 |              } else { // language code missing, redirect to some language version | 
| 107 | 107 | $lang = $controller->guessLanguage($request, $vocab); | 
| 108 | -                $newurl = $controller->getBaseHref() . $vocab . "/" . $lang . "/" . implode('/', array_slice($parts, 2)); | |
| 108 | +                $newurl = $controller->getBaseHref().$vocab."/".$lang."/".implode('/', array_slice($parts, 2)); | |
| 109 | 109 |                  $qs = $request->getServerConstant('QUERY_STRING'); | 
| 110 | 110 |                  if ($qs) { | 
| 111 | - $newurl .= "?" . $qs; | |
| 111 | + $newurl .= "?".$qs; | |
| 112 | 112 | } | 
| 113 | 113 |                  header("Location: $newurl"); | 
| 114 | 114 | } |