@@ -156,18 +156,18 @@ discard block |
||
| 156 | 156 | $localname = $vocab->getLocalName($uri); |
| 157 | 157 | if ($localname !== $uri && $localname === urlencode($localname)) { |
| 158 | 158 | // check that the prefix stripping worked, and there are no problematic chars in localname |
| 159 | - $paramstr = count($params) > 0 ? '?' . http_build_query($params) : ''; |
|
| 159 | + $paramstr = count($params) > 0 ? '?'.http_build_query($params) : ''; |
|
| 160 | 160 | if ($type && $type !== '' && $type !== 'vocab' && !($localname === '' && $type === 'page')) { |
| 161 | - return "$vocid/$lang/$type/$localname" . $paramstr; |
|
| 161 | + return "$vocid/$lang/$type/$localname".$paramstr; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | - return "$vocid/$lang/$localname" . $paramstr; |
|
| 164 | + return "$vocid/$lang/$localname".$paramstr; |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | // case 2: URI outside vocabulary namespace, or has problematic chars |
| 168 | 168 | // pass the full URI as parameter instead |
| 169 | 169 | $params['uri'] = $uri; |
| 170 | - return "$vocid/$lang/$type/?" . http_build_query($params); |
|
| 170 | + return "$vocid/$lang/$type/?".http_build_query($params); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | { |
| 294 | 294 | if ($modifiedDate) { |
| 295 | 295 | $ifModifiedSince = $this->getIfModifiedSince(); |
| 296 | - $this->sendHeader("Last-Modified: " . $modifiedDate->format('D, d M Y H:i:s \G\M\T')); |
|
| 296 | + $this->sendHeader("Last-Modified: ".$modifiedDate->format('D, d M Y H:i:s \G\M\T')); |
|
| 297 | 297 | if ($ifModifiedSince !== null && $ifModifiedSince >= $modifiedDate) { |
| 298 | 298 | $this->sendHeader("HTTP/1.0 304 Not Modified"); |
| 299 | 299 | return true; |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | $baseurl = $this->getBaseHref(); |
| 17 | 17 | $vocid = $vocab->getId(); |
| 18 | 18 | $query = http_build_query(array('uri'=>$uri, 'format'=>$targetFormat)); |
| 19 | - $url = $baseurl . "rest/v1/$vocid/data?$query"; |
|
| 19 | + $url = $baseurl."rest/v1/$vocid/data?$query"; |
|
| 20 | 20 | $this->redirect303($url); |
| 21 | 21 | } |
| 22 | 22 | |
@@ -27,16 +27,16 @@ discard block |
||
| 27 | 27 | $localname = $vocab->getLocalName($uri); |
| 28 | 28 | |
| 29 | 29 | if (!$localname) { |
| 30 | - $url = $baseurl . "$vocid/"; |
|
| 30 | + $url = $baseurl."$vocid/"; |
|
| 31 | 31 | } else { |
| 32 | 32 | |
| 33 | 33 | if ($localname !== $uri && $localname === urlencode($localname)) { |
| 34 | 34 | // the URI can be shortened |
| 35 | - $url = $baseurl . "$vocid/page/$localname"; |
|
| 35 | + $url = $baseurl."$vocid/page/$localname"; |
|
| 36 | 36 | } else { |
| 37 | 37 | // must use full URI |
| 38 | 38 | $query = http_build_query(array('uri'=>$uri)); |
| 39 | - $url = $baseurl . "$vocid/page/?" . $query; |
|
| 39 | + $url = $baseurl."$vocid/page/?".$query; |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | $this->redirect303($url); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | // guess vocabulary based on URI |
| 59 | 59 | $vocab = $this->model->guessVocabularyFromURI($request->getUri()); |
| 60 | 60 | if ($vocab === null) { |
| 61 | - return $this->returnError('404', 'Not Found', 'Unrecognized URI ' . $request->getUri()); |
|
| 61 | + return $this->returnError('404', 'Not Found', 'Unrecognized URI '.$request->getUri()); |
|
| 62 | 62 | } |
| 63 | 63 | $request->setVocab($vocab->getId()); |
| 64 | 64 | } |
@@ -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, |
@@ -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 | } |
@@ -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; |
@@ -961,7 +961,7 @@ discard block |
||
| 961 | 961 | } |
| 962 | 962 | } |
| 963 | 963 | // if the main concept scheme was not found, set 'top' to the first 'tops' (sorted alphabetically on the URIs) |
| 964 | - if (! isset($results[$uri]['top'])) { |
|
| 964 | + if (!isset($results[$uri]['top'])) { |
|
| 965 | 965 | $results[$uri]['top'] = $results[$uri]['tops'][0]; |
| 966 | 966 | } |
| 967 | 967 | } else { |
@@ -1147,7 +1147,7 @@ discard block |
||
| 1147 | 1147 | $changeList = $request->getVocab()->getChangeList($prop, $request->getLang(), $offset, $limit); |
| 1148 | 1148 | |
| 1149 | 1149 | $simpleChangeList = array(); |
| 1150 | - foreach($changeList as $conceptInfo) { |
|
| 1150 | + foreach ($changeList as $conceptInfo) { |
|
| 1151 | 1151 | if (array_key_exists('date', $conceptInfo)) { |
| 1152 | 1152 | $concept = array( |
| 1153 | 1153 | 'uri' => $conceptInfo['uri'], |
@@ -1164,10 +1164,10 @@ discard block |
||
| 1164 | 1164 | } |
| 1165 | 1165 | return $this->returnJson(array_merge_recursive( |
| 1166 | 1166 | $this->context, |
| 1167 | - array('@context' => array( '@language' => $request->getLang(), |
|
| 1167 | + array('@context' => array('@language' => $request->getLang(), |
|
| 1168 | 1168 | 'prefLabel' => 'skos:prefLabel', |
| 1169 | 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') ) |
|
| 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 | )); |
@@ -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 | } |
@@ -37,9 +37,9 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | // specify where to look for templates and cache |
| 40 | - $loader = new \Twig\Loader\FilesystemLoader(__DIR__ . '/../view'); |
|
| 40 | + $loader = new \Twig\Loader\FilesystemLoader(__DIR__.'/../view'); |
|
| 41 | 41 | // initialize Twig environment |
| 42 | - $this->twig = new \Twig\Environment($loader, array('cache' => $tmpDir,'auto_reload' => true)); |
|
| 42 | + $this->twig = new \Twig\Environment($loader, array('cache' => $tmpDir, 'auto_reload' => true)); |
|
| 43 | 43 | // used for setting the base href for the relative urls |
| 44 | 44 | $this->twig->addGlobal("BaseHref", $this->getBaseHref()); |
| 45 | 45 | // setting the service name string from the config.ttl |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $this->twig->addFilter(new \Twig\TwigFilter('link_url', array($this, 'linkUrlFilter'))); |
| 62 | 62 | |
| 63 | 63 | // register a Twig filter for generating strings from language codes with CLDR |
| 64 | - $langFilter = new \Twig\TwigFilter('lang_name', function ($langcode, $lang) { |
|
| 64 | + $langFilter = new \Twig\TwigFilter('lang_name', function($langcode, $lang) { |
|
| 65 | 65 | return Language::getName($langcode, $lang); |
| 66 | 66 | }); |
| 67 | 67 | $this->twig->addFilter($langFilter); |
@@ -247,16 +247,16 @@ discard block |
||
| 247 | 247 | |
| 248 | 248 | private function createFeedbackHeaders($fromName, $fromEmail, $toMail, $sender) |
| 249 | 249 | { |
| 250 | - $headers = "MIME-Version: 1.0" . "\r\n"; |
|
| 251 | - $headers .= "Content-type: text/html; charset=UTF-8" . "\r\n"; |
|
| 250 | + $headers = "MIME-Version: 1.0"."\r\n"; |
|
| 251 | + $headers .= "Content-type: text/html; charset=UTF-8"."\r\n"; |
|
| 252 | 252 | if (!empty($toMail)) { |
| 253 | - $headers .= "Cc: " . $this->model->getConfig()->getFeedbackAddress() . "\r\n"; |
|
| 253 | + $headers .= "Cc: ".$this->model->getConfig()->getFeedbackAddress()."\r\n"; |
|
| 254 | 254 | } |
| 255 | 255 | if (!empty($fromEmail)) { |
| 256 | 256 | $headers .= "Reply-To: $fromName <$fromEmail>\r\n"; |
| 257 | 257 | } |
| 258 | 258 | $service = $this->model->getConfig()->getServiceName(); |
| 259 | - return $headers . "From: $fromName via $service <$sender>"; |
|
| 259 | + return $headers."From: $fromName via $service <$sender>"; |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | /** |
@@ -270,9 +270,9 @@ discard block |
||
| 270 | 270 | public function sendFeedback($request, $message, $messageSubject, $fromName = null, $fromEmail = null, $fromVocab = null, $toMail = null) |
| 271 | 271 | { |
| 272 | 272 | $toAddress = ($toMail) ? $toMail : $this->model->getConfig()->getFeedbackAddress(); |
| 273 | - $messageSubject = "[" . $this->model->getConfig()->getServiceName() . "] " . $messageSubject; |
|
| 273 | + $messageSubject = "[".$this->model->getConfig()->getServiceName()."] ".$messageSubject; |
|
| 274 | 274 | if ($fromVocab !== null && $fromVocab !== '') { |
| 275 | - $message = 'Feedback from vocab: ' . strtoupper($fromVocab) . "<br />" . $message; |
|
| 275 | + $message = 'Feedback from vocab: '.strtoupper($fromVocab)."<br />".$message; |
|
| 276 | 276 | } |
| 277 | 277 | $envelopeSender = $this->model->getConfig()->getFeedbackEnvelopeSender(); |
| 278 | 278 | // determine the sender address of the message |
@@ -291,10 +291,10 @@ discard block |
||
| 291 | 291 | $headers = $this->createFeedbackHeaders($fromName, $fromEmail, $toMail, $sender); |
| 292 | 292 | $params = empty($envelopeSender) ? '' : "-f $envelopeSender"; |
| 293 | 293 | // adding some information about the user for debugging purposes. |
| 294 | - $message = $message . "<br /><br /> Debugging information:" |
|
| 295 | - . "<br />Timestamp: " . date(DATE_RFC2822) |
|
| 296 | - . "<br />User agent: " . $request->getServerConstant('HTTP_USER_AGENT') |
|
| 297 | - . "<br />Referer: " . $request->getServerConstant('HTTP_REFERER'); |
|
| 294 | + $message = $message."<br /><br /> Debugging information:" |
|
| 295 | + . "<br />Timestamp: ".date(DATE_RFC2822) |
|
| 296 | + . "<br />User agent: ".$request->getServerConstant('HTTP_USER_AGENT') |
|
| 297 | + . "<br />Referer: ".$request->getServerConstant('HTTP_REFERER'); |
|
| 298 | 298 | |
| 299 | 299 | try { |
| 300 | 300 | mail($toAddress, $messageSubject, $message, $headers, $params); |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | header("HTTP/1.0 404 Not Found"); |
| 303 | 303 | $template = $this->twig->load('error.twig'); |
| 304 | 304 | if ($this->model->getConfig()->getLogCaughtExceptions()) { |
| 305 | - error_log('Caught exception: ' . $e->getMessage()); |
|
| 305 | + error_log('Caught exception: '.$e->getMessage()); |
|
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | echo $template->render( |
@@ -349,13 +349,13 @@ discard block |
||
| 349 | 349 | $vocids = ($vocabs !== null && $vocabs !== '') ? explode(' ', $vocabs) : null; |
| 350 | 350 | $vocabObjects = array(); |
| 351 | 351 | if ($vocids) { |
| 352 | - foreach($vocids as $vocid) { |
|
| 352 | + foreach ($vocids as $vocid) { |
|
| 353 | 353 | try { |
| 354 | 354 | $vocabObjects[] = $this->model->getVocabulary($vocid); |
| 355 | 355 | } catch (ValueError $e) { |
| 356 | 356 | // fail fast with an error page if the vocabulary cannot be found |
| 357 | 357 | if ($this->model->getConfig()->getLogCaughtExceptions()) { |
| 358 | - error_log('Caught exception: ' . $e->getMessage()); |
|
| 358 | + error_log('Caught exception: '.$e->getMessage()); |
|
| 359 | 359 | } |
| 360 | 360 | header("HTTP/1.0 400 Bad Request"); |
| 361 | 361 | $this->invokeGenericErrorPage($request, $e->getMessage()); |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | $errored = true; |
| 378 | 378 | header("HTTP/1.0 500 Internal Server Error"); |
| 379 | 379 | if ($this->model->getConfig()->getLogCaughtExceptions()) { |
| 380 | - error_log('Caught exception: ' . $e->getMessage()); |
|
| 380 | + error_log('Caught exception: '.$e->getMessage()); |
|
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | $vocabList = $this->model->getVocabularyList(); |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | 'search_count' => $counts, |
| 390 | 390 | 'languages' => $this->languages, |
| 391 | 391 | 'search_results' => $searchResults, |
| 392 | - 'rest' => $parameters->getOffset()>0, |
|
| 392 | + 'rest' => $parameters->getOffset() > 0, |
|
| 393 | 393 | 'global_search' => true, |
| 394 | 394 | 'search_failed' => $errored, |
| 395 | 395 | 'term' => $request->getQueryParamRaw('q'), |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | } catch (Exception $e) { |
| 418 | 418 | header("HTTP/1.0 500 Internal Server Error"); |
| 419 | 419 | if ($this->model->getConfig()->getLogCaughtExceptions()) { |
| 420 | - error_log('Caught exception: ' . $e->getMessage()); |
|
| 420 | + error_log('Caught exception: '.$e->getMessage()); |
|
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | echo $template->render( |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | } catch (Exception $e) { |
| 443 | 443 | header("HTTP/1.0 404 Not Found"); |
| 444 | 444 | if ($this->model->getConfig()->getLogCaughtExceptions()) { |
| 445 | - error_log('Caught exception: ' . $e->getMessage()); |
|
| 445 | + error_log('Caught exception: '.$e->getMessage()); |
|
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | echo $template->render( |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | 'vocab' => $vocab, |
| 462 | 462 | 'search_results' => $searchResults, |
| 463 | 463 | 'search_count' => $counts, |
| 464 | - 'rest' => $parameters->getOffset()>0, |
|
| 464 | + 'rest' => $parameters->getOffset() > 0, |
|
| 465 | 465 | 'limit_parent' => $parameters->getParentLimit(), |
| 466 | 466 | 'limit_type' => $request->getQueryParam('type') ? explode('+', $request->getQueryParam('type')) : null, |
| 467 | 467 | 'limit_group' => $parameters->getGroupLimit(), |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * @param string $super URI of superproperty |
| 31 | 31 | * @param boolean $sort_by_notation whether to sort the property values by their notation code |
| 32 | 32 | */ |
| 33 | - public function __construct($model, $prop, $label, $tooltip=null, $super=null, $sort_by_notation=false) |
|
| 33 | + public function __construct($model, $prop, $label, $tooltip = null, $super = null, $sort_by_notation = false) |
|
| 34 | 34 | { |
| 35 | 35 | $this->model = $model; |
| 36 | 36 | $this->prop = $prop; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | public function getDescription() |
| 81 | 81 | { |
| 82 | - $helpprop = $this->prop . "_help"; |
|
| 82 | + $helpprop = $this->prop."_help"; |
|
| 83 | 83 | |
| 84 | 84 | // see if we have a translation with the help text |
| 85 | 85 | $help = $this->model->getText($helpprop); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | public function addValue($value) |
| 112 | 112 | { |
| 113 | - $this->values[ltrim($value->getNotation() . ' ') . $value->getLabel() . rtrim(' ' . $value->getUri())] = $value; |
|
| 113 | + $this->values[ltrim($value->getNotation().' ').$value->getLabel().rtrim(' '.$value->getUri())] = $value; |
|
| 114 | 114 | $this->is_sorted = false; |
| 115 | 115 | } |
| 116 | 116 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | # Note that getLabel() returns URIs in case of no label and may return a prefixed value which affects sorting |
| 121 | 121 | if (!empty($this->values)) { |
| 122 | 122 | if ($this->sort_by_notation) { |
| 123 | - uasort($this->values, function ($a, $b) { |
|
| 123 | + uasort($this->values, function($a, $b) { |
|
| 124 | 124 | $anot = $a->getNotation(); |
| 125 | 125 | $bnot = $b->getNotation(); |
| 126 | 126 | if ($anot == null) { |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | } |
| 142 | 142 | }); |
| 143 | 143 | } else { |
| 144 | - uasort($this->values, function ($a, $b) { |
|
| 144 | + uasort($this->values, function($a, $b) { |
|
| 145 | 145 | // assume that sort keys are unique |
| 146 | 146 | return strcoll($a->getSortKey(), $b->getSortKey()); |
| 147 | 147 | }); |
@@ -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); |