@@ -44,7 +44,7 @@ |
||
44 | 44 | return Punic\Calendar::formatDate($val, 'short'); |
45 | 45 | } catch (Exception $e) { |
46 | 46 | trigger_error($e->getMessage(), E_USER_WARNING); |
47 | - return (string) $this->literal; |
|
47 | + return (string)$this->literal; |
|
48 | 48 | } |
49 | 49 | } |
50 | 50 | return $this->literal->getValue(); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | // wrap with JSONP callback if requested |
44 | 44 | if (filter_input(INPUT_GET, 'callback', FILTER_SANITIZE_STRING)) { |
45 | 45 | header("Content-type: application/javascript; charset=utf-8"); |
46 | - echo filter_input(INPUT_GET, 'callback', FILTER_UNSAFE_RAW) . "(" . json_encode($data) . ");"; |
|
46 | + echo filter_input(INPUT_GET, 'callback', FILTER_UNSAFE_RAW)."(".json_encode($data).");"; |
|
47 | 47 | return; |
48 | 48 | } |
49 | 49 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | // convert to vocids array to support multi-vocabulary search |
123 | 123 | $vocids = ($vocabs !== null && $vocabs !== '') ? explode(' ', $vocabs) : array(); |
124 | 124 | $vocabObjects = array(); |
125 | - foreach($vocids as $vocid) { |
|
125 | + foreach ($vocids as $vocid) { |
|
126 | 126 | $vocabObjects[] = $this->model->getVocabulary($vocid); |
127 | 127 | } |
128 | 128 | $parameters->setVocabularies($vocabObjects); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | if ($request->getQueryParam('labellang')) { |
169 | 169 | $ret['@context']['@language'] = $request->getQueryParam('labellang'); |
170 | 170 | } elseif ($request->getQueryParam('lang')) { |
171 | - $ret['@context']['@language'] = $request->getQueryParam('lang');; |
|
171 | + $ret['@context']['@language'] = $request->getQueryParam('lang'); ; |
|
172 | 172 | } |
173 | 173 | return $ret; |
174 | 174 | } |
@@ -513,10 +513,10 @@ discard block |
||
513 | 513 | |
514 | 514 | $format = $this->negotiateFormat(array_keys($urls), $request->getServerConstant('HTTP_ACCEPT'), $request->getQueryParam('format')); |
515 | 515 | if (!$format) { |
516 | - return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: " . implode(' ', array_keys($urls))); |
|
516 | + return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: ".implode(' ', array_keys($urls))); |
|
517 | 517 | } |
518 | 518 | |
519 | - header("Location: " . $urls[$format]); |
|
519 | + header("Location: ".$urls[$format]); |
|
520 | 520 | } |
521 | 521 | |
522 | 522 | private function returnDataResults($results, $format) { |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | |
571 | 571 | $format = $this->negotiateFormat(explode(' ', self::SUPPORTED_FORMATS), $request->getServerConstant('HTTP_ACCEPT'), $request->getQueryParam('format')); |
572 | 572 | if (!$format) { |
573 | - return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: " . self::SUPPORTED_FORMATS); |
|
573 | + return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: ".self::SUPPORTED_FORMATS); |
|
574 | 574 | } |
575 | 575 | |
576 | 576 | $vocid = $vocab ? $vocab->getId() : null; |
@@ -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 | } |
@@ -118,12 +118,12 @@ discard block |
||
118 | 118 | // 3. label in any language |
119 | 119 | $label = $this->resource->label(); |
120 | 120 | // if the label lang code is a subset of the ui lang eg. en-GB |
121 | - if ($label !== null && strpos($label->getLang(), $this->getEnvLang() . '-') === 0) { |
|
121 | + if ($label !== null && strpos($label->getLang(), $this->getEnvLang().'-') === 0) { |
|
122 | 122 | return $label->getValue(); |
123 | 123 | } |
124 | 124 | |
125 | 125 | if ($label !== null) { |
126 | - return $label->getValue() . " (" . $label->getLang() . ")"; |
|
126 | + return $label->getValue()." (".$label->getLang().")"; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | // empty |
@@ -448,14 +448,14 @@ discard block |
||
448 | 448 | |
449 | 449 | // making a human readable string from the timestamps |
450 | 450 | if ($created != '') { |
451 | - $ret = gettext('skosmos:created') . ' ' . (Punic\Calendar::formatDate($created, 'short')); |
|
451 | + $ret = gettext('skosmos:created').' '.(Punic\Calendar::formatDate($created, 'short')); |
|
452 | 452 | } |
453 | 453 | |
454 | 454 | if ($modified != '') { |
455 | 455 | if ($created != '') { |
456 | - $ret .= ', ' . gettext('skosmos:modified') . ' ' . (Punic\Calendar::formatDate($modified, 'short')); |
|
456 | + $ret .= ', '.gettext('skosmos:modified').' '.(Punic\Calendar::formatDate($modified, 'short')); |
|
457 | 457 | } else { |
458 | - $ret .= ' ' . ucfirst(gettext('skosmos:modified')) . ' ' . (Punic\Calendar::formatDate($modified, 'short')); |
|
458 | + $ret .= ' '.ucfirst(gettext('skosmos:modified')).' '.(Punic\Calendar::formatDate($modified, 'short')); |
|
459 | 459 | } |
460 | 460 | |
461 | 461 | } |
@@ -463,12 +463,12 @@ discard block |
||
463 | 463 | trigger_error($e->getMessage(), E_USER_WARNING); |
464 | 464 | $ret = ''; |
465 | 465 | if ($this->resource->get('dc:modified')) { |
466 | - $modified = (string) $this->resource->get('dc:modified'); |
|
467 | - $ret = gettext('skosmos:modified') . ' ' . $modified; |
|
466 | + $modified = (string)$this->resource->get('dc:modified'); |
|
467 | + $ret = gettext('skosmos:modified').' '.$modified; |
|
468 | 468 | } |
469 | 469 | if ($this->resource->get('dc:created')) { |
470 | - $created .= (string) $this->resource->get('dc:created'); |
|
471 | - $ret .= ' ' . gettext('skosmos:created') . ' ' . $created; |
|
470 | + $created .= (string)$this->resource->get('dc:created'); |
|
471 | + $ret .= ' '.gettext('skosmos:created').' '.$created; |
|
472 | 472 | } |
473 | 473 | } |
474 | 474 | return $ret; |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | $labels = array(); |
556 | 556 | foreach ($this->resource->allLiterals('skos:prefLabel') as $lit) { |
557 | 557 | // filtering away subsets of the current language eg. en vs en-GB |
558 | - if ($lit->getLang() != $this->clang && strpos($lit->getLang(), $this->getEnvLang() . '-') !== 0) { |
|
558 | + if ($lit->getLang() != $this->clang && strpos($lit->getLang(), $this->getEnvLang().'-') !== 0) { |
|
559 | 559 | $langName = Punic\Language::getName($lit->getLang(), $this->getEnvLang()) !== $lit->getLang() ? Punic\Language::getName($lit->getLang(), $this->getEnvLang()) : gettext($lit->getLang()); |
560 | 560 | $labels[$langName][] = new ConceptPropertyValueLiteral($lit, 'skos:prefLabel'); |
561 | 561 | } |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | } |
564 | 564 | foreach ($this->resource->allLiterals('skos:altLabel') as $lit) { |
565 | 565 | // filtering away subsets of the current language eg. en vs en-GB |
566 | - if ($lit->getLang() != $this->clang && strpos($lit->getLang(), $this->getEnvLang() . '-') !== 0) { |
|
566 | + if ($lit->getLang() != $this->clang && strpos($lit->getLang(), $this->getEnvLang().'-') !== 0) { |
|
567 | 567 | $langName = Punic\Language::getName($lit->getLang(), $this->getEnvLang()) ? Punic\Language::getName($lit->getLang(), $this->getEnvLang()) : gettext($lit->getLang()); |
568 | 568 | $labels[$langName][] = new ConceptPropertyValueLiteral($lit, 'skos:altLabel'); |
569 | 569 | } |
@@ -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 | /** |
@@ -65,15 +65,15 @@ discard block |
||
65 | 65 | private function initializeVocabularies() |
66 | 66 | { |
67 | 67 | if (!file_exists($this->getConfig()->getVocabularyConfigFile())) { |
68 | - throw new Exception($this->getConfig()->getVocabularyConfigFile() . ' is missing, please provide one.'); |
|
68 | + throw new Exception($this->getConfig()->getVocabularyConfigFile().' is missing, please provide one.'); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | try { |
72 | 72 | // use APC user cache to store parsed vocabularies.ttl configuration |
73 | 73 | if (function_exists('apc_store') && function_exists('apc_fetch')) { |
74 | 74 | // @codeCoverageIgnoreStart |
75 | - $key = realpath($this->getConfig()->getVocabularyConfigFile()) . ", " . filemtime($this->getConfig()->getVocabularyConfigFile()); |
|
76 | - $nskey = "namespaces of " . $key; |
|
75 | + $key = realpath($this->getConfig()->getVocabularyConfigFile()).", ".filemtime($this->getConfig()->getVocabularyConfigFile()); |
|
76 | + $nskey = "namespaces of ".$key; |
|
77 | 77 | $this->graph = apc_fetch($key); |
78 | 78 | $this->namespaces = apc_fetch($nskey); |
79 | 79 | if ($this->graph === false || $this->namespaces === false) { // was not found in cache |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $this->parseVocabularies($this->getConfig()->getVocabularyConfigFile()); |
87 | 87 | } |
88 | 88 | } catch (Exception $e) { |
89 | - echo "Error: " . $e->getMessage(); |
|
89 | + echo "Error: ".$e->getMessage(); |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | public function getVocabularyCategories() |
425 | 425 | { |
426 | 426 | $cats = $this->graph->allOfType('skos:Concept'); |
427 | - if(empty($cats)) { |
|
427 | + if (empty($cats)) { |
|
428 | 428 | return array(new VocabularyCategory($this, null)); |
429 | 429 | } |
430 | 430 | |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | // using apc cache for the resource if available |
572 | 572 | if (function_exists('apc_store') && function_exists('apc_fetch')) { |
573 | 573 | // @codeCoverageIgnoreStart |
574 | - $key = 'fetch: ' . EasyRdf_Utils::removeFragmentFromUri($uri); |
|
574 | + $key = 'fetch: '.EasyRdf_Utils::removeFragmentFromUri($uri); |
|
575 | 575 | $resource = apc_fetch($key); |
576 | 576 | if ($resource === null || $resource === false) { // was not found in cache, or previous request failed |
577 | 577 | $resource = $this->fetchResourceFromUri($uri); |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | */ |
593 | 593 | public function getSparqlImplementation($dialect, $endpoint, $graph) |
594 | 594 | { |
595 | - $classname = $dialect . "Sparql"; |
|
595 | + $classname = $dialect."Sparql"; |
|
596 | 596 | |
597 | 597 | return new $classname($endpoint, $graph, $this); |
598 | 598 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | { |
8 | 8 | private $plugins; |
9 | 9 | |
10 | - public function __construct($resource, $globalPlugins=array()) |
|
10 | + public function __construct($resource, $globalPlugins = array()) |
|
11 | 11 | { |
12 | 12 | $this->resource = $resource; |
13 | 13 | $plugins = $this->resource->allLiterals('skosmos:usePlugin'); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @param string $property the property to query |
41 | 41 | * @param string $lang preferred language for the literal, |
42 | 42 | */ |
43 | - private function getLiteral($property, $lang=null) |
|
43 | + private function getLiteral($property, $lang = null) |
|
44 | 44 | { |
45 | 45 | if (!isset($lang)) {; |
46 | 46 | $lang = $this->getEnvLang(); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $langs = $this->getLanguages(); |
73 | 73 | $deflang = reset($langs); // picking the first one from the list with reset since the keys are not numeric |
74 | 74 | if (sizeof($langs) > 1) { |
75 | - trigger_error("Default language for vocabulary '" . $this->getShortName() . "' unknown, choosing '$deflang'.", E_USER_WARNING); |
|
75 | + trigger_error("Default language for vocabulary '".$this->getShortName()."' unknown, choosing '$deflang'.", E_USER_WARNING); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | return $deflang; |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * @param string $prop property type eg. 'rdf:type'. |
22 | 22 | * @param string $label |
23 | 23 | */ |
24 | - public function __construct($prop, $label, $super=null) |
|
24 | + public function __construct($prop, $label, $super = null) |
|
25 | 25 | { |
26 | 26 | $this->prop = $prop; |
27 | 27 | $this->label = $label; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function getDescription() |
61 | 61 | { |
62 | - $helpprop = $this->prop . "_help"; |
|
62 | + $helpprop = $this->prop."_help"; |
|
63 | 63 | |
64 | 64 | return gettext($helpprop); // can't use string constant, it'd be picked up by xgettext |
65 | 65 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | public function addValue($value) |
80 | 80 | { |
81 | - $this->values[$value->getLabel() . $value->getUri()] = $value; |
|
81 | + $this->values[$value->getLabel().$value->getUri()] = $value; |
|
82 | 82 | $this->is_sorted = false; |
83 | 83 | } |
84 | 84 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | { |
87 | 87 | if (!empty($this->values)) { |
88 | 88 | uksort($this->values, function($a, $b) { |
89 | - return strnatcasecmp($a,$b); |
|
89 | + return strnatcasecmp($a, $b); |
|
90 | 90 | }); |
91 | 91 | } |
92 | 92 | $this->is_sorted = true; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | return $lname; |
98 | 98 | } |
99 | 99 | // already a full URI |
100 | - return $this->getUriSpace() . $lname; |
|
100 | + return $this->getUriSpace().$lname; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $prop = (substr($prop, 0, 5) == 'dc11:') ? str_replace('dc11:', 'dc:', $prop) : $prop; |
160 | 160 | $value = $val->getValue(); |
161 | 161 | if ($value instanceof DateTime) { |
162 | - $val = Punic\Calendar::formatDate($value, 'full', $lang) . ' ' . Punic\Calendar::format($value, 'HH:mm:ss', $lang); |
|
162 | + $val = Punic\Calendar::formatDate($value, 'full', $lang).' '.Punic\Calendar::format($value, 'HH:mm:ss', $lang); |
|
163 | 163 | } |
164 | 164 | $ret[$prop][] = $val; |
165 | 165 | } |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | } |
271 | 271 | // don't know how to parse |
272 | 272 | $rev = $parts[2]; |
273 | - $datestr = $parts[3] . ' ' . $parts[4]; |
|
273 | + $datestr = $parts[3].' '.$parts[4]; |
|
274 | 274 | |
275 | 275 | return "$datestr (r$rev)"; |
276 | 276 | } |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | * Counts the statistics of the vocabulary. |
280 | 280 | * @return array of the concept/group counts |
281 | 281 | */ |
282 | - public function getStatistics($lang = '', $array=null, $group=null) |
|
282 | + public function getStatistics($lang = '', $array = null, $group = null) |
|
283 | 283 | { |
284 | 284 | $sparql = $this->getSparql(); |
285 | 285 | // find the number of concepts |
@@ -595,14 +595,14 @@ discard block |
||
595 | 595 | { |
596 | 596 | $changelist = $this->getSparql()->queryChangeList($clang, $offset, $prop); |
597 | 597 | $bydate = array(); |
598 | - foreach($changelist as $concept) { |
|
598 | + foreach ($changelist as $concept) { |
|
599 | 599 | $concept['datestring'] = Punic\Calendar::formatDate($concept['date'], 'medium', $lang); |
600 | - $bydate[Punic\Calendar::getMonthName($concept['date'], 'wide', $lang, true) . Punic\Calendar::format($concept['date'], ' y', $lang) ][strtolower($concept['prefLabel'])] = $concept; |
|
600 | + $bydate[Punic\Calendar::getMonthName($concept['date'], 'wide', $lang, true).Punic\Calendar::format($concept['date'], ' y', $lang)][strtolower($concept['prefLabel'])] = $concept; |
|
601 | 601 | } |
602 | 602 | return $bydate; |
603 | 603 | } |
604 | 604 | |
605 | - public function getTitle($lang=null) { |
|
605 | + public function getTitle($lang = null) { |
|
606 | 606 | return $this->config->getTitle($lang); |
607 | 607 | } |
608 | 608 |