@@ -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 = ltrim($this->getNotation() . ' ') . $label; |
|
| 27 | + $label = ltrim($this->getNotation().' ').$label; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | return $label; |
@@ -47,9 +47,9 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | // We need to check all the labels in case one of them matches a subtag of the current language |
| 49 | 49 | if ($this->resource->allLiterals('skos:prefLabel')) { |
| 50 | - foreach($this->resource->allLiterals('skos:prefLabel') as $label) { |
|
| 50 | + foreach ($this->resource->allLiterals('skos:prefLabel') as $label) { |
|
| 51 | 51 | // the label lang code is a subtag of the UI lang eg. en-GB - create a new literal with the main language |
| 52 | - if ($label !== null && strpos($label->getLang(), $fallback . '-') === 0) { |
|
| 52 | + if ($label !== null && strpos($label->getLang(), $fallback.'-') === 0) { |
|
| 53 | 53 | return EasyRdf\Literal::create($label, $fallback); |
| 54 | 54 | } |
| 55 | 55 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | public function getReifiedPropertyValues() { |
| 142 | 142 | $ret = array(); |
| 143 | 143 | $props = $this->resource->propertyUris(); |
| 144 | - foreach($props as $prop) { |
|
| 144 | + foreach ($props as $prop) { |
|
| 145 | 145 | $prop = (EasyRdf\RdfNamespace::shorten($prop) !== null) ? EasyRdf\RdfNamespace::shorten($prop) : $prop; |
| 146 | 146 | foreach ($this->resource->allLiterals($prop) as $val) { |
| 147 | 147 | if ($prop !== 'rdf:value') { // shown elsewhere |
@@ -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 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | { |
| 89 | 89 | if (!empty($this->values)) { |
| 90 | 90 | uksort($this->values, function($a, $b) { |
| 91 | - return $this->sort_by_notation ? strnatcasecmp($a, $b) : strcoll(strtolower($a),strtolower($b)); |
|
| 91 | + return $this->sort_by_notation ? strnatcasecmp($a, $b) : strcoll(strtolower($a), strtolower($b)); |
|
| 92 | 92 | }); |
| 93 | 93 | } |
| 94 | 94 | $this->is_sorted = true; |
@@ -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() |
@@ -187,42 +187,42 @@ discard block |
||
| 187 | 187 | 'from' => [ |
| 188 | 188 | 'memberSet' => [ |
| 189 | 189 | [ |
| 190 | - 'uri' => (string) $this->source->getUri(), |
|
| 190 | + 'uri' => (string)$this->source->getUri(), |
|
| 191 | 191 | ] |
| 192 | 192 | ] |
| 193 | 193 | ], |
| 194 | 194 | 'to' => [ |
| 195 | 195 | 'memberSet' => [ |
| 196 | 196 | [ |
| 197 | - 'uri' => (string) $this->getUri() |
|
| 197 | + 'uri' => (string)$this->getUri() |
|
| 198 | 198 | ] |
| 199 | 199 | ] |
| 200 | 200 | ], |
| 201 | 201 | // EXTRA |
| 202 | - 'description' => gettext($this->type . "_help"), // pop-up text |
|
| 202 | + 'description' => gettext($this->type."_help"), // pop-up text |
|
| 203 | 203 | 'hrefLink' => $hrefLink, // link to resource as displayed in the UI |
| 204 | 204 | 'lang' => $propertyLang, // TBD: could it be part of the prefLabel? |
| 205 | - 'vocabName' => (string) $this->getVocabName(), // vocabulary as displayed in the UI |
|
| 205 | + 'vocabName' => (string)$this->getVocabName(), // vocabulary as displayed in the UI |
|
| 206 | 206 | 'typeLabel' => gettext($this->type), // a text used in the UI instead of, for example, skos:closeMatch |
| 207 | 207 | ]; |
| 208 | 208 | |
| 209 | 209 | $fromScheme = $this->vocab->getDefaultConceptScheme(); |
| 210 | 210 | if (isset($fromScheme)) { |
| 211 | 211 | $ret['fromScheme'] = [ |
| 212 | - 'uri' => (string) $fromScheme, |
|
| 212 | + 'uri' => (string)$fromScheme, |
|
| 213 | 213 | ]; |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | $exvocab = $this->getExvocab(); |
| 217 | 217 | if (isset($exvocab)) { |
| 218 | 218 | $ret['toScheme'] = [ |
| 219 | - 'uri' => (string) $exvocab->getDefaultConceptScheme(), |
|
| 219 | + 'uri' => (string)$exvocab->getDefaultConceptScheme(), |
|
| 220 | 220 | ]; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | $notation = $this->getNotation(); |
| 224 | 224 | if (isset($notation)) { |
| 225 | - $ret['to']['memberSet'][0]['notation'] = (string) $notation; |
|
| 225 | + $ret['to']['memberSet'][0]['notation'] = (string)$notation; |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | $label = $this->getLabel($lang, $queryExVocabs); |