@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | "skos:related", "skos:historyNote", "skosmos:memberOf", |
30 | 30 | "skosmos:memberOfArray"); |
31 | 31 | |
32 | - public function __construct($resource, $globalPlugins=array()) |
|
32 | + public function __construct($resource, $globalPlugins = array()) |
|
33 | 33 | { |
34 | 34 | $this->resource = $resource; |
35 | 35 | $this->globalPlugins = $globalPlugins; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * @return \EasyRdf\Literal value as a string |
52 | 52 | */ |
53 | 53 | public function getUsePluginAsLiteral($plugin) : string { |
54 | - return (string) $plugin->getLiteral('skosmos:usePlugin')->getValue(); |
|
54 | + return (string)$plugin->getLiteral('skosmos:usePlugin')->getValue(); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $paramValue = $paramLiteral->getValue(); |
171 | 171 | $paramLang = $paramLiteral->getLang(); |
172 | 172 | if ($paramLang) { |
173 | - $paramName .= '_' . $paramLang; |
|
173 | + $paramName .= '_'.$paramLang; |
|
174 | 174 | } |
175 | 175 | $this->pluginParameters[$pluginName][$paramName] = $paramValue; |
176 | 176 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $labelProperty = $override->getResource('skosmos:property'); |
203 | 203 | $labelPropUri = $labelProperty->shorten(); |
204 | 204 | if (empty($this->labelOverrides[$labelPropUri])) { |
205 | - $this->labelOverrides[$labelPropUri] = array(); |
|
205 | + $this->labelOverrides[$labelPropUri] = array(); |
|
206 | 206 | } |
207 | 207 | $newOverrides = array(); |
208 | 208 | |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $langs = $this->getLanguages(); |
277 | 277 | $deflang = reset($langs); // picking the first one from the list with reset since the keys are not numeric |
278 | 278 | if (sizeof($langs) > 1) { |
279 | - trigger_error("Default language for vocabulary '" . $this->getShortName() . "' unknown, choosing '$deflang'.", E_USER_WARNING); |
|
279 | + trigger_error("Default language for vocabulary '".$this->getShortName()."' unknown, choosing '$deflang'.", E_USER_WARNING); |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | return $deflang; |
@@ -102,8 +102,7 @@ discard block |
||
102 | 102 | foreach ($vocabularyPlugins as $plugin) { |
103 | 103 | if ($plugin instanceof EasyRdf\Literal) { |
104 | 104 | $pluginArray[] = $plugin->getValue(); |
105 | - } |
|
106 | - else { |
|
105 | + } else { |
|
107 | 106 | $pluginArray[] = $plugin->getLiteral($this->getUsePluginAsLiteral()); |
108 | 107 | } |
109 | 108 | } |
@@ -299,8 +298,9 @@ discard block |
||
299 | 298 | public function getShortName() |
300 | 299 | { |
301 | 300 | $shortname = $this->getLiteral('skosmos:shortName'); |
302 | - if ($shortname) |
|
303 | - return $shortname; |
|
301 | + if ($shortname) { |
|
302 | + return $shortname; |
|
303 | + } |
|
304 | 304 | |
305 | 305 | // if no shortname exists fall back to the id |
306 | 306 | return $this->getId(); |
@@ -460,10 +460,12 @@ discard block |
||
460 | 460 | $ret = array(); |
461 | 461 | foreach ($resources as $res) { |
462 | 462 | $prop = $res->getURI(); |
463 | - if (EasyRdf\RdfNamespace::shorten($prop) !== null) // shortening property labels if possible |
|
463 | + if (EasyRdf\RdfNamespace::shorten($prop) !== null) { |
|
464 | + // shortening property labels if possible |
|
464 | 465 | { |
465 | 466 | $prop = EasyRdf\RdfNamespace::shorten($prop); |
466 | 467 | } |
468 | + } |
|
467 | 469 | |
468 | 470 | $ret[] = $prop; |
469 | 471 | } |
@@ -480,10 +482,12 @@ discard block |
||
480 | 482 | $resources = $this->resource->allResources("skosmos:hasMultiLingualProperty"); |
481 | 483 | foreach ($resources as $res) { |
482 | 484 | $prop = $res->getURI(); |
483 | - if (EasyRdf\RdfNamespace::shorten($prop) !== null) // shortening property labels if possible |
|
485 | + if (EasyRdf\RdfNamespace::shorten($prop) !== null) { |
|
486 | + // shortening property labels if possible |
|
484 | 487 | { |
485 | 488 | $prop = EasyRdf\RdfNamespace::shorten($prop); |
486 | 489 | } |
490 | + } |
|
487 | 491 | |
488 | 492 | if ($prop === $property) { |
489 | 493 | return true; |
@@ -638,11 +642,12 @@ discard block |
||
638 | 642 | public function getId() |
639 | 643 | { |
640 | 644 | $uriparts = explode("#", $this->resource->getURI()); |
641 | - if (count($uriparts) != 1) |
|
642 | - // hash namespace |
|
645 | + if (count($uriparts) != 1) { |
|
646 | + // hash namespace |
|
643 | 647 | { |
644 | 648 | return $uriparts[1]; |
645 | 649 | } |
650 | + } |
|
646 | 651 | |
647 | 652 | // slash namespace |
648 | 653 | $uriparts = explode("/", $this->resource->getURI()); |
@@ -670,10 +675,12 @@ discard block |
||
670 | 675 | $ret = array(); |
671 | 676 | foreach ($resources as $res) { |
672 | 677 | $prop = $res->getURI(); |
673 | - if (EasyRdf\RdfNamespace::shorten($prop) !== null) // prefixing if possible |
|
678 | + if (EasyRdf\RdfNamespace::shorten($prop) !== null) { |
|
679 | + // prefixing if possible |
|
674 | 680 | { |
675 | 681 | $prop = EasyRdf\RdfNamespace::shorten($prop); |
676 | 682 | } |
683 | + } |
|
677 | 684 | |
678 | 685 | $ret[] = $prop; |
679 | 686 | } |