@@ -64,15 +64,15 @@ discard block |
||
| 64 | 64 | private function initializeVocabularies() |
| 65 | 65 | { |
| 66 | 66 | if (!file_exists($this->getConfig()->getVocabularyConfigFile())) { |
| 67 | - throw new Exception($this->getConfig()->getVocabularyConfigFile() . ' is missing, please provide one.'); |
|
| 67 | + throw new Exception($this->getConfig()->getVocabularyConfigFile().' is missing, please provide one.'); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | try { |
| 71 | 71 | // use APC user cache to store parsed vocabularies.ttl configuration |
| 72 | 72 | if ($this->cache->isAvailable()) { |
| 73 | 73 | // @codeCoverageIgnoreStart |
| 74 | - $key = realpath($this->getConfig()->getVocabularyConfigFile()) . ", " . filemtime($this->getConfig()->getVocabularyConfigFile()); |
|
| 75 | - $nskey = "namespaces of " . $key; |
|
| 74 | + $key = realpath($this->getConfig()->getVocabularyConfigFile()).", ".filemtime($this->getConfig()->getVocabularyConfigFile()); |
|
| 75 | + $nskey = "namespaces of ".$key; |
|
| 76 | 76 | $this->graph = $this->cache->fetch($key); |
| 77 | 77 | $this->namespaces = $this->cache->fetch($nskey); |
| 78 | 78 | if ($this->graph === false || $this->namespaces === false) { // was not found in cache |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $this->parseVocabularies($this->getConfig()->getVocabularyConfigFile()); |
| 86 | 86 | } |
| 87 | 87 | } catch (Exception $e) { |
| 88 | - echo "Error: " . $e->getMessage(); |
|
| 88 | + echo "Error: ".$e->getMessage(); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | public function getVocabularyCategories() |
| 457 | 457 | { |
| 458 | 458 | $cats = $this->graph->allOfType('skos:Concept'); |
| 459 | - if(empty($cats)) { |
|
| 459 | + if (empty($cats)) { |
|
| 460 | 460 | return array(new VocabularyCategory($this, null)); |
| 461 | 461 | } |
| 462 | 462 | |
@@ -629,7 +629,7 @@ discard block |
||
| 629 | 629 | // using apc cache for the resource if available |
| 630 | 630 | if ($this->cache->isAvailable()) { |
| 631 | 631 | // @codeCoverageIgnoreStart |
| 632 | - $key = 'fetch: ' . $uri; |
|
| 632 | + $key = 'fetch: '.$uri; |
|
| 633 | 633 | $resource = $this->cache->fetch($key); |
| 634 | 634 | if ($resource === null || $resource === false) { // was not found in cache, or previous request failed |
| 635 | 635 | $resource = $this->fetchResourceFromUri($uri); |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | */ |
| 651 | 651 | public function getSparqlImplementation($dialect, $endpoint, $graph) |
| 652 | 652 | { |
| 653 | - $classname = $dialect . "Sparql"; |
|
| 653 | + $classname = $dialect."Sparql"; |
|
| 654 | 654 | |
| 655 | 655 | return new $classname($endpoint, $graph, $this); |
| 656 | 656 | } |
@@ -121,9 +121,9 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | // 3. label in a subtag of the current language |
| 123 | 123 | // We need to check all the labels in case one of them matches a subtag of the current language |
| 124 | - foreach($this->resource->allLiterals('skos:prefLabel') as $label) { |
|
| 124 | + foreach ($this->resource->allLiterals('skos:prefLabel') as $label) { |
|
| 125 | 125 | // the label lang code is a subtag of the UI lang eg. en-GB - create a new literal with the main language |
| 126 | - if ($label !== null && strpos($label->getLang(), $lang . '-') === 0) { |
|
| 126 | + if ($label !== null && strpos($label->getLang(), $lang.'-') === 0) { |
|
| 127 | 127 | return EasyRdf\Literal::create($label, $lang); |
| 128 | 128 | } |
| 129 | 129 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | // 4. label in any language, including literal with empty language tag |
| 132 | 132 | $label = $this->resource->label(); |
| 133 | 133 | if ($label !== null) { |
| 134 | - return $label->getLang() ? $label->getValue() . " (" . $label->getLang() . ")" : $label->getValue(); |
|
| 134 | + return $label->getLang() ? $label->getValue()." (".$label->getLang().")" : $label->getValue(); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | // empty |
@@ -462,14 +462,14 @@ discard block |
||
| 462 | 462 | |
| 463 | 463 | // making a human readable string from the timestamps |
| 464 | 464 | if ($created != '') { |
| 465 | - $ret = gettext('skosmos:created') . ' ' . (Punic\Calendar::formatDate($created, 'short')); |
|
| 465 | + $ret = gettext('skosmos:created').' '.(Punic\Calendar::formatDate($created, 'short')); |
|
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | if ($modified != '') { |
| 469 | 469 | if ($created != '') { |
| 470 | - $ret .= ', ' . gettext('skosmos:modified') . ' ' . (Punic\Calendar::formatDate($modified, 'short')); |
|
| 470 | + $ret .= ', '.gettext('skosmos:modified').' '.(Punic\Calendar::formatDate($modified, 'short')); |
|
| 471 | 471 | } else { |
| 472 | - $ret .= ' ' . ucfirst(gettext('skosmos:modified')) . ' ' . (Punic\Calendar::formatDate($modified, 'short')); |
|
| 472 | + $ret .= ' '.ucfirst(gettext('skosmos:modified')).' '.(Punic\Calendar::formatDate($modified, 'short')); |
|
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | } |
@@ -477,12 +477,12 @@ discard block |
||
| 477 | 477 | trigger_error($e->getMessage(), E_USER_WARNING); |
| 478 | 478 | $ret = ''; |
| 479 | 479 | if ($this->resource->get('dc:modified')) { |
| 480 | - $modified = (string) $this->resource->get('dc:modified'); |
|
| 481 | - $ret = gettext('skosmos:modified') . ' ' . $modified; |
|
| 480 | + $modified = (string)$this->resource->get('dc:modified'); |
|
| 481 | + $ret = gettext('skosmos:modified').' '.$modified; |
|
| 482 | 482 | } |
| 483 | 483 | if ($this->resource->get('dc:created')) { |
| 484 | - $created .= (string) $this->resource->get('dc:created'); |
|
| 485 | - $ret .= ' ' . gettext('skosmos:created') . ' ' . $created; |
|
| 484 | + $created .= (string)$this->resource->get('dc:created'); |
|
| 485 | + $ret .= ' '.gettext('skosmos:created').' '.$created; |
|
| 486 | 486 | } |
| 487 | 487 | } |
| 488 | 488 | return $ret; |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | $ret = array(); |
| 593 | 593 | foreach ($labels as $lit) { |
| 594 | 594 | // filtering away subsets of the current language eg. en vs en-GB |
| 595 | - if ($lit->getLang() != $this->clang && strpos($lit->getLang(), $this->getEnvLang() . '-') !== 0) { |
|
| 595 | + if ($lit->getLang() != $this->clang && strpos($lit->getLang(), $this->getEnvLang().'-') !== 0) { |
|
| 596 | 596 | $prop = in_array($lit, $prefLabels) ? 'skos:prefLabel' : 'skos:altLabel'; |
| 597 | 597 | $ret[$this->literalLanguageToString($lit)][] = new ConceptPropertyValueLiteral($lit, $prop); |
| 598 | 598 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | $label = is_string($this->getLabel()) ? $this->getLabel() : $this->getLabel()->getValue(); |
| 26 | 26 | if ($this->vocab->getConfig()->sortByNotation()) { |
| 27 | - $label = $this->getNotation() . $label; |
|
| 27 | + $label = $this->getNotation().$label; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | return $label; |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | public function getReifiedPropertyValues() { |
| 121 | 121 | $ret = array(); |
| 122 | 122 | $props = $this->resource->propertyUris(); |
| 123 | - foreach($props as $prop) { |
|
| 123 | + foreach ($props as $prop) { |
|
| 124 | 124 | $prop = (EasyRdf\RdfNamespace::shorten($prop) !== null) ? EasyRdf\RdfNamespace::shorten($prop) : $prop; |
| 125 | 125 | foreach ($this->resource->allLiterals($prop) as $val) { |
| 126 | 126 | if ($prop !== 'rdf:value' && $this->resource->get($prop)) { // shown elsewhere |