@@ -312,8 +312,7 @@ discard block |
||
312 | 312 | foreach ($res->propertyUris() as $prop) { |
313 | 313 | $this->addPropertyValues($res, $prop, $seen); |
314 | 314 | } |
315 | - } |
|
316 | - else { |
|
315 | + } else { |
|
317 | 316 | foreach ($props as $prop) { |
318 | 317 | if ($res->hasProperty($prop)) { |
319 | 318 | $this->addPropertyValues($res, $prop, $seen); |
@@ -678,7 +677,9 @@ discard block |
||
678 | 677 | $subPrefLabelProps = $this->graph->resourcesMatching('rdfs:subPropertyOf', $prefLabelProp); |
679 | 678 | foreach ($subPrefLabelProps as $subPrefLabelProp) { |
680 | 679 | // return the first available translation |
681 | - if ($subPrefLabelProp->label($lang)) return $subPrefLabelProp->label($lang); |
|
680 | + if ($subPrefLabelProp->label($lang)) { |
|
681 | + return $subPrefLabelProp->label($lang); |
|
682 | + } |
|
682 | 683 | } |
683 | 684 | return null; |
684 | 685 | } |
@@ -909,8 +910,7 @@ discard block |
||
909 | 910 | if (!in_array($vocabUriSpace, $context, true)) { |
910 | 911 | if (!isset($context[$vocabPrefix])) { |
911 | 912 | $context[$vocabPrefix] = $vocabUriSpace; |
912 | - } |
|
913 | - else if ($context[$vocabPrefix] !== $vocabUriSpace) { |
|
913 | + } else if ($context[$vocabPrefix] !== $vocabUriSpace) { |
|
914 | 914 | $i = 2; |
915 | 915 | while (isset($context[$vocabPrefix . $i]) && $context[$vocabPrefix . $i] !== $vocabUriSpace) { |
916 | 916 | $i += 1; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * @param string $prop property type eg. 'rdf:type'. |
23 | 23 | * @param string $label |
24 | 24 | */ |
25 | - public function __construct($prop, $label, $super=null, $sort_by_notation=false) |
|
25 | + public function __construct($prop, $label, $super = null, $sort_by_notation = false) |
|
26 | 26 | { |
27 | 27 | $this->prop = $prop; |
28 | 28 | $this->label = $label; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public function getDescription() |
63 | 63 | { |
64 | - $helpprop = $this->prop . "_help"; |
|
64 | + $helpprop = $this->prop."_help"; |
|
65 | 65 | |
66 | 66 | return gettext($helpprop); // can't use string constant, it'd be picked up by xgettext |
67 | 67 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | public function addValue($value) |
82 | 82 | { |
83 | - $this->values[ltrim($value->getNotation() . ' ') . $value->getLabel() . rtrim(' ' . $value->getUri())] = $value; |
|
83 | + $this->values[ltrim($value->getNotation().' ').$value->getLabel().rtrim(' '.$value->getUri())] = $value; |
|
84 | 84 | $this->is_sorted = false; |
85 | 85 | } |
86 | 86 |
@@ -99,17 +99,14 @@ |
||
99 | 99 | return strcoll(strtolower($a->getLabel()), strtolower($b->getLabel())); |
100 | 100 | } |
101 | 101 | return 1; |
102 | - } |
|
103 | - else if ($bnot == null) { |
|
102 | + } else if ($bnot == null) { |
|
104 | 103 | return -1; |
105 | - } |
|
106 | - else { |
|
104 | + } else { |
|
107 | 105 | // assume that notations are unique |
108 | 106 | return strnatcasecmp($anot, $bnot); |
109 | 107 | } |
110 | 108 | }); |
111 | - } |
|
112 | - else { |
|
109 | + } else { |
|
113 | 110 | uasort($this->values, function($a, $b) { |
114 | 111 | // assume that labels are unique |
115 | 112 | return strcoll(strtolower($a->getLabel()), strtolower($b->getLabel())); |