| @@ -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 | } | 
| @@ -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, 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 | ||
| 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 | } | 
| @@ -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 | } | 
| @@ -53,15 +53,15 @@ | ||
| 53 | 53 | |
| 54 | 54 | $localname = $vocab->getLocalName($uri); | 
| 55 | 55 |          if ($localname !== $uri && $localname === urlencode($localname)) { | 
| 56 | - $paramstr = count($params) > 0 ? '?' . http_build_query($params) : ''; | |
| 56 | + $paramstr = count($params) > 0 ? '?'.http_build_query($params) : ''; | |
| 57 | 57 |              if ($type && $type !== '' && $type !== 'vocab' && !($localname === '' && $type === 'page')) { | 
| 58 | - return "$vocid/$lang/$type/$localname" . $paramstr; | |
| 58 | + return "$vocid/$lang/$type/$localname".$paramstr; | |
| 59 | 59 | } | 
| 60 | 60 | |
| 61 | - return "$vocid/$lang/$localname" . $paramstr; | |
| 61 | + return "$vocid/$lang/$localname".$paramstr; | |
| 62 | 62 | } | 
| 63 | 63 | |
| 64 | 64 | $params['uri'] = $uri; | 
| 65 | - return "$vocid/$lang/$type/?" . http_build_query($params); | |
| 65 | + return "$vocid/$lang/$type/?".http_build_query($params); | |
| 66 | 66 | } | 
| 67 | 67 | } | 
| @@ -220,7 +220,7 @@ | ||
| 220 | 220 |      { | 
| 221 | 221 |          if ($modifiedDate) { | 
| 222 | 222 | $ifModifiedSince = $this->getIfModifiedSince(); | 
| 223 | -            $this->sendHeader("Last-Modified: " . $modifiedDate->format('D, d M Y H:i:s \G\M\T')); | |
| 223 | +            $this->sendHeader("Last-Modified: ".$modifiedDate->format('D, d M Y H:i:s \G\M\T')); | |
| 224 | 224 |              if ($ifModifiedSince !== null && $ifModifiedSince >= $modifiedDate) { | 
| 225 | 225 |                  $this->sendHeader("HTTP/1.0 304 Not Modified"); | 
| 226 | 226 | return true; |