Passed
Push — deprecated-concept-display-fix... ( 59d2e4 )
by Osma
05:50
created
model/ConceptSearchParameters.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,11 +71,11 @@
 block discarded – undo
71 71
         if ((!isset($term) || strlen(trim($term)) === 0) && $this->rest)
72 72
             $term = $this->request->getQueryParamRaw('label');
73 73
         $term = trim(strval($term)); // surrounding whitespace is not considered significant
74
-        $term = Normalizer::normalize( $term, Normalizer::FORM_C ); //Normalize decomposed unicode characters #1184
74
+        $term = Normalizer::normalize($term, Normalizer::FORM_C); //Normalize decomposed unicode characters #1184
75 75
         if ($this->rest) {
76 76
             return $term;
77 77
         }
78
-        return strpos($term, "*") === false ? $term . "*" : $term; // default to prefix search
78
+        return strpos($term, "*") === false ? $term."*" : $term; // default to prefix search
79 79
     }
80 80
 
81 81
     public function getContentLang()
Please login to merge, or discard this patch.
model/Concept.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
                 return $this->resource->label($fallback);
143 143
             }
144 144
             // We need to check all the labels in case one of them matches a subtag of the current language
145
-            foreach($this->resource->allLiterals('skos:prefLabel') as $label) {
145
+            foreach ($this->resource->allLiterals('skos:prefLabel') as $label) {
146 146
                 // the label lang code is a subtag of the UI lang eg. en-GB - create a new literal with the main language
147
-                if ($label !== null && strpos($label->getLang(), $fallback . '-') === 0) {
147
+                if ($label !== null && strpos($label->getLang(), $fallback.'-') === 0) {
148 148
                     return EasyRdf\Literal::create($label, $fallback);
149 149
                 }
150 150
             }
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
     public function getXlLabel()
173 173
     {
174 174
         $labels = $this->resource->allResources('skosxl:prefLabel');
175
-        foreach($labels as $labres) {
175
+        foreach ($labels as $labres) {
176 176
             $label = $labres->getLiteral('skosxl:literalForm');
177 177
             if ($label !== null && $label->getLang() == $this->clang) {
178 178
                 return new LabelSkosXL($this->model, $labres);
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
         // catch external subjects that have $res as object
280 280
         $extSubjects = $exGraph->resourcesMatching("schema:about", $res);
281 281
 
282
-        $propList =  array_unique(array_merge(
282
+        $propList = array_unique(array_merge(
283 283
             $this->DEFAULT_EXT_PROPERTIES,
284 284
             $this->getVocab()->getConfig()->getExtProperties(),
285 285
             $this->getVocab()->getConfig()->getPluginRegister()->getExtProperties()
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
      * @param string[] $seen Processed resources so far
305 305
      * @param string[] $props (optional) limit to these property URIs
306 306
      */
307
-    private function addExternalTriplesToGraph($res, &$seen, $props=null)
307
+    private function addExternalTriplesToGraph($res, &$seen, $props = null)
308 308
     {
309 309
         if (array_key_exists($res->getUri(), $seen) && $seen[$res->getUri()] === 0) {
310 310
             return;
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
      */
335 335
     private function addPropertyValues($res, $prop, &$seen)
336 336
     {
337
-        $resList = $res->allResources('<' . $prop . '>');
337
+        $resList = $res->allResources('<'.$prop.'>');
338 338
 
339 339
         foreach ($resList as $res2) {
340 340
             if ($res2->isBNode()) {
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
             $this->addResourceReifications($res, $prop, $res2, $seen);
345 345
         }
346 346
 
347
-        $litList = $res->allLiterals('<' . $prop . '>');
347
+        $litList = $res->allLiterals('<'.$prop.'>');
348 348
 
349 349
         foreach ($litList as $lit) {
350 350
             $this->graph->addLiteral($res, $prop, $lit);
@@ -532,15 +532,15 @@  discard block
 block discarded – undo
532 532
                 // if not found in current vocabulary, look up in the default graph to be able
533 533
                 // to read an ontology loaded in a separate graph
534 534
                 // note that this imply that the property has an rdf:type declared for the query to work
535
-                if(!$is_well_known && !$proplabel) {
535
+                if (!$is_well_known && !$proplabel) {
536 536
                     $envLangLabels = $this->model->getDefaultSparql()->queryLabel($longUri, $this->getEnvLang());
537 537
                     
538 538
                     $defaultPropLabel = $this->model->getDefaultSparql()->queryLabel($longUri, '');
539 539
 
540
-					if($envLangLabels) {
540
+					if ($envLangLabels) {
541 541
 						$proplabel = $envLangLabels[$this->getEnvLang()];
542 542
                     } else {
543
-						if($defaultPropLabel) {
543
+						if ($defaultPropLabel) {
544 544
 							$proplabel = $defaultPropLabel[''];
545 545
 						}
546 546
 					}
@@ -553,12 +553,12 @@  discard block
 block discarded – undo
553 553
                 }
554 554
 
555 555
                 // also look up superprops in the default graph if not found in current vocabulary
556
-                if(!$is_well_known && (!$superprops || empty($superprops))) {
556
+                if (!$is_well_known && (!$superprops || empty($superprops))) {
557 557
                     $superprops = $this->model->getDefaultSparql()->querySuperProperties($longUri);
558 558
                 }
559 559
 
560 560
                 // we're reading only one super property, even if there are multiple ones
561
-                $superprop = ($superprops)?$superprops[0]:null;
561
+                $superprop = ($superprops) ? $superprops[0] : null;
562 562
                 if ($superprop) {
563 563
                     $superprop = EasyRdf\RdfNamespace::shorten($superprop) ? EasyRdf\RdfNamespace::shorten($superprop) : $superprop;
564 564
                 }
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
                 }
572 572
 
573 573
                 // searching for subproperties of literals too
574
-                if($superprops) {
574
+                if ($superprops) {
575 575
                     foreach ($superprops as $subi) {
576 576
                         $suburi = EasyRdf\RdfNamespace::shorten($subi) ? EasyRdf\RdfNamespace::shorten($subi) : $subi;
577 577
                         $duplicates[$suburi] = $prop;
@@ -732,14 +732,14 @@  discard block
 block discarded – undo
732 732
 
733 733
             // making a human readable string from the timestamps
734 734
             if ($created != '') {
735
-                $ret = gettext('skosmos:created') . ' ' . (Punic\Calendar::formatDate($created, 'short', $this->getEnvLang()));
735
+                $ret = gettext('skosmos:created').' '.(Punic\Calendar::formatDate($created, 'short', $this->getEnvLang()));
736 736
             }
737 737
 
738 738
             if ($modified != '') {
739 739
                 if ($created != '') {
740
-                    $ret .= ', ' . gettext('skosmos:modified') . ' ' . (Punic\Calendar::formatDate($modified, 'short', $this->getEnvLang()));
740
+                    $ret .= ', '.gettext('skosmos:modified').' '.(Punic\Calendar::formatDate($modified, 'short', $this->getEnvLang()));
741 741
                 } else {
742
-                    $ret .= ' ' . ucfirst(gettext('skosmos:modified')) . ' ' . (Punic\Calendar::formatDate($modified, 'short', $this->getEnvLang()));
742
+                    $ret .= ' '.ucfirst(gettext('skosmos:modified')).' '.(Punic\Calendar::formatDate($modified, 'short', $this->getEnvLang()));
743 743
                 }
744 744
 
745 745
             }
@@ -747,12 +747,12 @@  discard block
 block discarded – undo
747 747
             trigger_error($e->getMessage(), E_USER_WARNING);
748 748
             $ret = '';
749 749
             if ($this->resource->get('dc:modified')) {
750
-                $modified = (string) $this->resource->get('dc:modified');
751
-                $ret = gettext('skosmos:modified') . ' ' . $modified;
750
+                $modified = (string)$this->resource->get('dc:modified');
751
+                $ret = gettext('skosmos:modified').' '.$modified;
752 752
             }
753 753
             if ($this->resource->get('dc:created')) {
754
-                $created .= (string) $this->resource->get('dc:created');
755
-                $ret .= ' ' . gettext('skosmos:created') . ' ' . $created;
754
+                $created .= (string)$this->resource->get('dc:created');
755
+                $ret .= ' '.gettext('skosmos:created').' '.$created;
756 756
             }
757 757
         }
758 758
         return $ret;
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
                     $groups[$collLabel] = array($group);
825 825
 
826 826
                     $res = $collection;
827
-                    while($super = $this->graph->resourcesMatching('skos:member', $res)) {
827
+                    while ($super = $this->graph->resourcesMatching('skos:member', $res)) {
828 828
                         foreach ($super as $res) {
829 829
                             $superprop = new ConceptPropertyValue($this->model, $this->vocab, $res, 'skosmos:memberOfSuper', $this->clang);
830 830
                             array_unshift($groups[$collLabel], $superprop);
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
         foreach ($labels as $lit) {
871 871
             // filtering away subsets of the current language eg. en vs en-GB
872 872
             $langCode = strval($lit->getLang());
873
-            if ($langCode != $this->clang && strpos($langCode, $this->getEnvLang() . '-') !== 0) {
873
+            if ($langCode != $this->clang && strpos($langCode, $this->getEnvLang().'-') !== 0) {
874 874
                 $ret[$langCode][$key][] = new ConceptPropertyValueLiteral($this->model, $this->vocab, $this->resource, $lit, $prop);
875 875
             }
876 876
         }
@@ -961,10 +961,10 @@  discard block
 block discarded – undo
961 961
             }
962 962
             else if ($context[$vocabPrefix] !== $vocabUriSpace) {
963 963
                 $i = 2;
964
-                while (isset($context[$vocabPrefix . $i]) && $context[$vocabPrefix . $i] !== $vocabUriSpace) {
964
+                while (isset($context[$vocabPrefix.$i]) && $context[$vocabPrefix.$i] !== $vocabUriSpace) {
965 965
                     $i += 1;
966 966
                 }
967
-                $context[$vocabPrefix . $i] = $vocabUriSpace;
967
+                $context[$vocabPrefix.$i] = $vocabUriSpace;
968 968
             }
969 969
         }
970 970
         $compactJsonLD = \ML\JsonLD\JsonLD::compact($this->graph->serialise('jsonld'), json_encode($context));
Please login to merge, or discard this patch.
model/ConceptPropertyValueLiteral.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
                 return Punic\Calendar::formatDate($val, 'short');
70 70
             } catch (Exception $e) {
71 71
                 trigger_error($e->getMessage(), E_USER_WARNING);
72
-                return (string) $this->literal;
72
+                return (string)$this->literal;
73 73
             }
74 74
         }
75 75
         return $this->literal->getValue();
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     {
96 96
         $graph = $this->resource->getGraph();
97 97
         $labelResources = $graph->resourcesMatching('skosxl:literalForm', $this->literal);
98
-        foreach($labelResources as $labres) {
98
+        foreach ($labelResources as $labres) {
99 99
           $xlLabel = new LabelSkosXL($this->model, $labres);
100 100
           if ($xlLabel->getLang() == $this->getLang()) {
101 101
             return $xlLabel;
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
     }
10 10
     require_once 'vendor/autoload.php';
11 11
 } catch (Exception $e) {
12
-    echo "Error: " . $e->getMessage();
12
+    echo "Error: ".$e->getMessage();
13 13
     return;
14 14
 }
15 15
 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     // if language code missing, redirect to guessed language
28 28
     // in any case, redirect to <lang>/
29 29
     $lang = sizeof($parts) == 2 && $parts[1] !== '' ? $parts[1] : $controller->guessLanguage($request);
30
-    header("Location: " . $lang . "/");
30
+    header("Location: ".$lang."/");
31 31
 } else {
32 32
   if (array_key_exists($parts[1], $config->getLanguages())) { // global pages
33 33
         $request->setLang($parts[1]);
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
         }
57 57
         if (sizeof($parts) == 3) { // language code missing
58 58
             $lang = $controller->guessLanguage($request);
59
-            $newurl = $controller->getBaseHref() . $vocab . "/" . $lang . "/";
60
-            header("Location: " . $newurl);
59
+            $newurl = $controller->getBaseHref().$vocab."/".$lang."/";
60
+            header("Location: ".$newurl);
61 61
         } else {
62 62
             if (array_key_exists($parts[2], $config->getLanguages())) {
63 63
                 $lang = $parts[2];
@@ -98,10 +98,10 @@  discard block
 block discarded – undo
98 98
                 }
99 99
             } else { // language code missing, redirect to some language version
100 100
                 $lang = $controller->guessLanguage($request, $vocab);
101
-                $newurl = $controller->getBaseHref() . $vocab . "/" . $lang . "/" . implode('/', array_slice($parts, 2));
101
+                $newurl = $controller->getBaseHref().$vocab."/".$lang."/".implode('/', array_slice($parts, 2));
102 102
                 $qs = $request->getServerConstant('QUERY_STRING');
103 103
                 if ($qs) {
104
-                    $newurl .= "?" . $qs;
104
+                    $newurl .= "?".$qs;
105 105
                 }
106 106
                 header("Location: $newurl");
107 107
             }
Please login to merge, or discard this patch.
model/Request.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
      * @param int $maxlength maximum length of parameter, or null if unlimited
124 124
      * @return string parameter content, or null if no parameter found
125 125
      */
126
-    public function getQueryParamPOST($paramName, $maxlength=null)
126
+    public function getQueryParamPOST($paramName, $maxlength = null)
127 127
     {
128 128
         if (!isset($this->queryParamsPOST[$paramName])) return null;
129 129
         $val = filter_var($this->queryParamsPOST[$paramName], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 
215 215
     public function getRequestUri()
216 216
     {
217
-        return $this->getServerConstant('HTTP_HOST') . $this->getServerConstant('REQUEST_URI');
217
+        return $this->getServerConstant('HTTP_HOST').$this->getServerConstant('REQUEST_URI');
218 218
     }
219 219
 
220 220
     /**
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
      * @param string $newlang new UI language to set
223 223
      * @return string the relative url of the page
224 224
      */
225
-    public function getLangUrl($newlang=null)
225
+    public function getLangUrl($newlang = null)
226 226
     {
227 227
         $script_name = str_replace('/index.php', '', $this->getServerConstant('SCRIPT_NAME'));
228 228
         $langurl = substr(str_replace($script_name, '', strval($this->getServerConstant('REQUEST_URI'))), 1);
Please login to merge, or discard this patch.
model/Vocabulary.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
             return $lname;
106 106
         }
107 107
         // already a full URI
108
-        return $this->getUriSpace() . $lname;
108
+        return $this->getUriSpace().$lname;
109 109
     }
110 110
 
111 111
     /**
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             $result = $sparql->queryConceptScheme($defaultcs);
168 168
         } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) {
169 169
              if ($this->model->getConfig()->getLogCaughtExceptions()) {
170
-                 error_log('Caught exception: ' . $e->getMessage());
170
+                 error_log('Caught exception: '.$e->getMessage());
171 171
              }
172 172
              return null;
173 173
         }
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
                 foreach ($conceptscheme->allLiterals($prop, null) as $val) {
205 205
                     $prop = (substr($prop, 0, 5) == 'dc11:') ? str_replace('dc11:', 'dc:', $prop) : $prop;
206 206
                     if ($val->getValue() instanceof DateTime) {
207
-                        $val = Punic\Calendar::formatDate($val->getValue(), 'full', $lang) . ' ' . Punic\Calendar::format($val->getValue(), 'HH:mm:ss', $lang);
207
+                        $val = Punic\Calendar::formatDate($val->getValue(), 'full', $lang).' '.Punic\Calendar::format($val->getValue(), 'HH:mm:ss', $lang);
208 208
                     }
209 209
                     if ($prop === 'dc:description') {
210 210
                         $ret[$prop] = [$val->getValue() => $val]; // override description from vocabulary config
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
             $conceptSchemes = $this->getSparql()->queryConceptSchemes($lang);
266 266
         } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) {
267 267
              if ($this->model->getConfig()->getLogCaughtExceptions()) {
268
-                 error_log('Caught exception: ' . $e->getMessage());
268
+                 error_log('Caught exception: '.$e->getMessage());
269 269
              }
270 270
         }
271 271
         return $conceptSchemes;
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
         }
337 337
         // don't know how to parse
338 338
         $rev = $parts[2];
339
-        $datestr = $parts[3] . ' ' . $parts[4];
339
+        $datestr = $parts[3].' '.$parts[4];
340 340
 
341 341
         return "$datestr (r$rev)";
342 342
     }
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
      * @param string $array the uri of the concept array class, eg. isothes:ThesaurusArray
348 348
      * @param string $group the uri of the  concept group class, eg. isothes:ConceptGroup
349 349
      */
350
-    public function getStatistics($lang = '', $array=null, $group=null)
350
+    public function getStatistics($lang = '', $array = null, $group = null)
351 351
     {
352 352
         $sparql = $this->getSparql();
353 353
         // find the number of concepts
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
             $conceptInfo = $sparql->queryConceptInfo($uri, $this->config->getArrayClassURI(), array($this), $clang);
466 466
         } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) {
467 467
              if ($this->model->getConfig()->getLogCaughtExceptions()) {
468
-                 error_log('Caught exception: ' . $e->getMessage());
468
+                 error_log('Caught exception: '.$e->getMessage());
469 469
              }
470 470
         }
471 471
         return $conceptInfo;
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
         return $this->getSparql()->queryChangeList($prop, $clang, $offset, $limit, $showDeprecated);
677 677
     }
678 678
 
679
-    public function getTitle($lang=null) {
679
+    public function getTitle($lang = null) {
680 680
       return $this->config->getTitle($lang);
681 681
     }
682 682
 
Please login to merge, or discard this patch.
controller/RestController.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         // wrap with JSONP callback if requested
26 26
         if (filter_input(INPUT_GET, 'callback', FILTER_SANITIZE_FULL_SPECIAL_CHARS)) {
27 27
             header("Content-type: application/javascript; charset=utf-8");
28
-            echo filter_input(INPUT_GET, 'callback', FILTER_SANITIZE_FULL_SPECIAL_CHARS, FILTER_FLAG_NO_ENCODE_QUOTES) . "(" . json_encode($data) . ");";
28
+            echo filter_input(INPUT_GET, 'callback', FILTER_SANITIZE_FULL_SPECIAL_CHARS, FILTER_FLAG_NO_ENCODE_QUOTES)."(".json_encode($data).");";
29 29
             return;
30 30
         }
31 31
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
                 'vocabularies' => 'onki:hasVocabulary',
89 89
                 'id' => 'onki:vocabularyIdentifier',
90 90
                 'uri' => '@id',
91
-                '@base' => $this->getBaseHref() . "rest/v1/vocabularies",
91
+                '@base' => $this->getBaseHref()."rest/v1/vocabularies",
92 92
             ),
93 93
             'uri' => '',
94 94
             'vocabularies' => $results,
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         // convert to vocids array to support multi-vocabulary search
106 106
         $vocids = ($vocabs !== null && $vocabs !== '') ? explode(' ', $vocabs) : array();
107 107
         $vocabObjects = array();
108
-        foreach($vocids as $vocid) {
108
+        foreach ($vocids as $vocid) {
109 109
             $vocabObjects[] = $this->model->getVocabulary($vocid);
110 110
         }
111 111
         $parameters->setVocabularies($vocabObjects);
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
         foreach ($parameters->getAdditionalFields() as $field) {
137 137
 
138 138
             // Quick-and-dirty compactification
139
-            $context[$field] = 'skos:' . $field;
139
+            $context[$field] = 'skos:'.$field;
140 140
             foreach ($results as &$result) {
141 141
                 foreach ($result as $k => $v) {
142
-                    if ($k == 'skos:' . $field) {
142
+                    if ($k == 'skos:'.$field) {
143 143
                         $result[$field] = $v;
144
-                        unset($result['skos:' . $field]);
144
+                        unset($result['skos:'.$field]);
145 145
                     }
146 146
                 }
147 147
             }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
                 'prefLabel' => 'skos:prefLabel',
233 233
                 'title' => 'dct:title',
234 234
                 '@language' => $request->getLang(),
235
-                '@base' => $this->getBaseHref() . "rest/v1/" . $vocab->getId() . "/",
235
+                '@base' => $this->getBaseHref()."rest/v1/".$vocab->getId()."/",
236 236
             ),
237 237
             'uri' => '',
238 238
             'id' => $vocab->getId(),
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
                 'subTypes' => array('@id' => 'void:class', '@type' => '@id'),
288 288
                 'count' => 'void:entities',
289 289
                 '@language' => $request->getLang(),
290
-                '@base' => $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/",
290
+                '@base' => $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/",
291 291
             ),
292 292
             'uri' => '',
293 293
             'id' => $request->getVocab()->getId(),
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
                 'language' => 'void-ext:language',
370 370
                 'properties' => 'void:propertyPartition',
371 371
                 'labels' => 'void:triples',
372
-                '@base' => $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/",
372
+                '@base' => $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/",
373 373
             ),
374 374
             'uri' => '',
375 375
             'id' => $request->getVocab()->getId(),
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
             $types[] = $type;
411 411
         }
412 412
 
413
-        $base = $request->getVocab() ? $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/" : $this->getBaseHref() . "rest/v1/";
413
+        $base = $request->getVocab() ? $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/" : $this->getBaseHref()."rest/v1/";
414 414
 
415 415
         $ret = array_merge_recursive($this->context, array(
416 416
             '@context' => array(
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
         if ($lang === null) {
452 452
             // case 1A: exact match on preferred label in any language
453 453
             foreach ($results as $res) {
454
-                if (isset($res['matchedPrefLabel']) && $res['matchedPrefLabel']  == $label) {
454
+                if (isset($res['matchedPrefLabel']) && $res['matchedPrefLabel'] == $label) {
455 455
                     $res['prefLabel'] = $res['matchedPrefLabel'];
456 456
                     unset($res['matchedPrefLabel']);
457 457
                     $hits[] = $res;
@@ -573,19 +573,19 @@  discard block
 block discarded – undo
573 573
 
574 574
         $format = $this->negotiateFormat(array_keys($urls), $request->getServerConstant('HTTP_ACCEPT'), $request->getQueryParam('format'));
575 575
         if (!$format) {
576
-            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: " . implode(' ', array_keys($urls)));
576
+            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: ".implode(' ', array_keys($urls)));
577 577
         }
578 578
         if (is_array($urls[$format])) {
579 579
             $arr = $urls[$format];
580 580
             $dataLang = $request->getLang();
581 581
             if (isset($arr[$dataLang])) {
582
-                header("Location: " . $arr[$dataLang]);
582
+                header("Location: ".$arr[$dataLang]);
583 583
             } else {
584 584
                 $vocid = $request->getVocab()->getId();
585 585
                 return $this->returnError('404', 'Not Found', "No download source URL known for vocabulary $vocid in language $dataLang");
586 586
             }
587 587
 		} else {
588
-            header("Location: " . $urls[$format]);
588
+            header("Location: ".$urls[$format]);
589 589
 		}
590 590
     }
591 591
 
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 
649 649
         $format = $this->negotiateFormat(explode(' ', self::SUPPORTED_FORMATS), $request->getServerConstant('HTTP_ACCEPT'), $request->getQueryParam('format'));
650 650
         if (!$format) {
651
-            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: " . self::SUPPORTED_FORMATS);
651
+            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: ".self::SUPPORTED_FORMATS);
652 652
         }
653 653
 
654 654
         $vocid = $vocab ? $vocab->getId() : null;
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
                         }
934 934
                     }
935 935
                     // if the main concept scheme was not found, set 'top' to the first 'tops' (sorted alphabetically on the URIs)
936
-                    if (! isset($results[$uri]['top'])) {
936
+                    if (!isset($results[$uri]['top'])) {
937 937
                         $results[$uri]['top'] = $results[$uri]['tops'][0];
938 938
                     }
939 939
                 } else {
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
         $changeList = $request->getVocab()->getChangeList($prop, $request->getLang(), $offset, $limit);
1112 1112
 
1113 1113
         $simpleChangeList = array();
1114
-        foreach($changeList as $conceptInfo) {
1114
+        foreach ($changeList as $conceptInfo) {
1115 1115
             if (array_key_exists('date', $conceptInfo)) {
1116 1116
                 $concept = array(
1117 1117
                     'uri' => $conceptInfo['uri'],
@@ -1127,10 +1127,10 @@  discard block
 block discarded – undo
1127 1127
             }
1128 1128
         }
1129 1129
         return $this->returnJson(array_merge_recursive($this->context,
1130
-                                                        array('@context' => array( '@language' => $request->getLang(),
1130
+                                                        array('@context' => array('@language' => $request->getLang(),
1131 1131
                                                                                      'prefLabel' => 'skos:prefLabel',
1132 1132
                                                                                      'xsd' => 'http://www.w3.org/2001/XMLSchema#',
1133
-                                                                                     'date' => array( '@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime') )
1133
+                                                                                     'date' => array('@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime'))
1134 1134
                                                         ),
1135 1135
                                                         array('changeList' => $simpleChangeList)));
1136 1136
 
Please login to merge, or discard this patch.
model/sparql/GenericSparql.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
     {
105 105
         $queryId = sprintf("%05d", rand(0, 99999));
106 106
         $logger = $this->model->getLogger();
107
-        $logger->info("[qid $queryId] SPARQL query:\n" . $this->generateQueryPrefixes($query) . "\n$query\n");
107
+        $logger->info("[qid $queryId] SPARQL query:\n".$this->generateQueryPrefixes($query)."\n$query\n");
108 108
         $starttime = microtime(true);
109 109
         $result = $this->client->query($query);
110 110
         $elapsed = intval(round((microtime(true) - $starttime) * 1000));
111
-        if(method_exists($result, 'numRows')) {
111
+        if (method_exists($result, 'numRows')) {
112 112
             $numRows = $result->numRows();
113 113
             $logger->info("[qid $queryId] result: $numRows rows returned in $elapsed ms");
114 114
         } else { // graph result
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
      */
127 127
     protected function query($query)
128 128
     {
129
-        $key = $this->endpoint . " " . $query;
129
+        $key = $this->endpoint." ".$query;
130 130
         if (!array_key_exists($key, self::$querycache)) {
131 131
             self::$querycache[$key] = $this->doQuery($query);
132 132
         }
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      * @param Vocabulary[]|null $vocabs
140 140
      * @return string
141 141
      */
142
-    protected function generateFromClause($vocabs=null) {
142
+    protected function generateFromClause($vocabs = null) {
143 143
         $clause = '';
144 144
         if (!$vocabs) {
145 145
             return $this->graph !== '?graph' && $this->graph !== NULL ? "FROM <$this->graph>" : '';
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 
282 282
 	$quote_string = function($val) { return "'$val'"; };
283 283
 	$quoted_values = array_map($quote_string, $langs);
284
-	$langFilter = "FILTER(?lang IN (" . implode(',', $quoted_values) . "))";
284
+	$langFilter = "FILTER(?lang IN (".implode(',', $quoted_values)."))";
285 285
 
286 286
         $values = $this->formatValues('?type', $classes, 'uri');
287 287
         $valuesProp = $this->formatValues('?prop', $props, null);
@@ -725,9 +725,9 @@  discard block
 block discarded – undo
725 725
                 $conceptscheme['title'] = $row->title->getValue();
726 726
             }
727 727
             // add dct:subject and their labels in the result
728
-            if(isset($row->domain) && isset($row->domainLabel)){
729
-                $conceptscheme['subject']['uri']=$row->domain->getURI();
730
-                $conceptscheme['subject']['prefLabel']=$row->domainLabel->getValue();
728
+            if (isset($row->domain) && isset($row->domainLabel)) {
729
+                $conceptscheme['subject']['uri'] = $row->domain->getURI();
730
+                $conceptscheme['subject']['prefLabel'] = $row->domainLabel->getValue();
731 731
             }
732 732
 
733 733
             $ret[$row->cs->getURI()] = $conceptscheme;
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
           $values[] = "<$graph>";
795 795
         }
796 796
         if (count($values)) {
797
-          return "FILTER (?graph IN (" . implode(',', $values) . "))";
797
+          return "FILTER (?graph IN (".implode(',', $values)."))";
798 798
         }
799 799
     }
800 800
 
@@ -805,16 +805,16 @@  discard block
 block discarded – undo
805 805
      * @return string sparql query clauses
806 806
      */
807 807
     protected function formatLimitAndOffset($limit, $offset) {
808
-        $limit = ($limit) ? 'LIMIT ' . $limit : '';
809
-        $offset = ($offset) ? 'OFFSET ' . $offset : '';
808
+        $limit = ($limit) ? 'LIMIT '.$limit : '';
809
+        $offset = ($offset) ? 'OFFSET '.$offset : '';
810 810
         // eliminating whitespace and line changes when the conditions aren't needed.
811 811
         $limitandoffset = '';
812 812
         if ($limit && $offset) {
813
-            $limitandoffset = "\n" . $limit . "\n" . $offset;
813
+            $limitandoffset = "\n".$limit."\n".$offset;
814 814
         } elseif ($limit) {
815
-            $limitandoffset = "\n" . $limit;
815
+            $limitandoffset = "\n".$limit;
816 816
         } elseif ($offset) {
817
-            $limitandoffset = "\n" . $offset;
817
+            $limitandoffset = "\n".$offset;
818 818
         }
819 819
 
820 820
         return $limitandoffset;
@@ -953,7 +953,7 @@  discard block
 block discarded – undo
953 953
      * @param string|null $distinguisher SPARQL property path from concept to distinguisher object in case of shared prefLabels
954 954
      * @return string sparql query
955 955
      */
956
-    protected function generateConceptSearchQueryInner($term, $lang, $searchLang, $props, $unique, $filterGraph, $distinguisher=null)
956
+    protected function generateConceptSearchQueryInner($term, $lang, $searchLang, $props, $unique, $filterGraph, $distinguisher = null)
957 957
     {
958 958
         $valuesProp = $this->formatValues('?prop', $props);
959 959
         $textcond = $this->generateConceptSearchQueryCondition($term, $searchLang);
@@ -967,31 +967,31 @@  discard block
 block discarded – undo
967 967
         // if search language and UI/display language differ, must also consider case where there is no prefLabel in
968 968
         // the display language; in that case, should use the label with the same language as the matched label
969 969
         $labelcondFallback = ($searchLang != $lang) ?
970
-          "OPTIONAL { # in case previous OPTIONAL block gives no labels\n" .
970
+          "OPTIONAL { # in case previous OPTIONAL block gives no labels\n".
971 971
           "?s skos:prefLabel ?label . FILTER (LANGMATCHES(LANG(?label), LANG(?match))) }" : "";
972 972
 
973 973
         //  Including the labels if there is no query term given.
974 974
         if ($rawterm === '') {
975 975
           $labelClause = "?s skos:prefLabel ?label .";
976
-          $labelClause = ($lang) ? $labelClause . " FILTER (LANGMATCHES(LANG(?label), '$lang'))" : $labelClause . "";
977
-          return $labelClause . " BIND(?label AS ?match)";
976
+          $labelClause = ($lang) ? $labelClause." FILTER (LANGMATCHES(LANG(?label), '$lang'))" : $labelClause."";
977
+          return $labelClause." BIND(?label AS ?match)";
978 978
         }
979 979
 
980 980
         $distinguishercondLabel = "FILTER (LANG(?distLabel) = LANG(?label))";
981 981
         // Only include distinguisher labels in case of a shared prefLabel
982 982
         $distinguisherClause = $distinguisher ?
983
-            "OPTIONAL {\n" .
984
-            "  ?s skos:prefLabel ?label . ?s2 skos:prefLabel ?label . FILTER(?s2 != ?s)\n" .
985
-            "  ?s $distinguisher ?distinguisher.\n" .
986
-            "  FILTER (!isLiteral(?distinguisher) || (LANG(?distinguisher) = LANG(?label)))" .
987
-            "  OPTIONAL {\n" .
988
-            "    ?distinguisher skos:prefLabel ?distLabel .\n" .
989
-            "    $distinguishercondLabel\n" .
990
-            "  }\n" .
991
-            "  OPTIONAL {\n" .
992
-            "    ?distinguisher rdfs:label ?distLabel .\n" .
993
-            "    $distinguishercondLabel\n" .
994
-            "  }\n" .
983
+            "OPTIONAL {\n".
984
+            "  ?s skos:prefLabel ?label . ?s2 skos:prefLabel ?label . FILTER(?s2 != ?s)\n".
985
+            "  ?s $distinguisher ?distinguisher.\n".
986
+            "  FILTER (!isLiteral(?distinguisher) || (LANG(?distinguisher) = LANG(?label)))".
987
+            "  OPTIONAL {\n".
988
+            "    ?distinguisher skos:prefLabel ?distLabel .\n".
989
+            "    $distinguishercondLabel\n".
990
+            "  }\n".
991
+            "  OPTIONAL {\n".
992
+            "    ?distinguisher rdfs:label ?distLabel .\n".
993
+            "    $distinguishercondLabel\n".
994
+            "  }\n".
995 995
             "} BIND(COALESCE(?distLabel,STR(?distinguisher)) AS ?distcoal) " : "";
996 996
 
997 997
         /*
@@ -1064,20 +1064,20 @@  discard block
 block discarded – undo
1064 1064
         $schemecond = '';
1065 1065
         if (!empty($schemes)) {
1066 1066
             $conditions = array();
1067
-            foreach($schemes as $scheme) {
1067
+            foreach ($schemes as $scheme) {
1068 1068
                 $conditions[] = "{?s skos:inScheme <$scheme>}";
1069 1069
             }
1070
-            $schemecond = '{'.implode(" UNION ",$conditions).'}';
1070
+            $schemecond = '{'.implode(" UNION ", $conditions).'}';
1071 1071
         }
1072
-        $filterDeprecated="";
1072
+        $filterDeprecated = "";
1073 1073
         //show or hide deprecated concepts
1074
-        if(!$showDeprecated){
1075
-            $filterDeprecated="FILTER NOT EXISTS { ?s owl:deprecated true }";
1074
+        if (!$showDeprecated) {
1075
+            $filterDeprecated = "FILTER NOT EXISTS { ?s owl:deprecated true }";
1076 1076
         }
1077 1077
         // extra conditions for parent and group, if specified
1078
-        $parentcond = ($params->getParentLimit()) ? "?s skos:broader+ <" . $params->getParentLimit() . "> ." : "";
1079
-        $groupcond = ($params->getGroupLimit()) ? "<" . $params->getGroupLimit() . "> skos:member ?s ." : "";
1080
-        $pgcond = $parentcond . $groupcond;
1078
+        $parentcond = ($params->getParentLimit()) ? "?s skos:broader+ <".$params->getParentLimit()."> ." : "";
1079
+        $groupcond = ($params->getGroupLimit()) ? "<".$params->getGroupLimit()."> skos:member ?s ." : "";
1080
+        $pgcond = $parentcond.$groupcond;
1081 1081
 
1082 1082
         $orderextra = $this->isDefaultEndpoint() ? $this->graph : '';
1083 1083
 
@@ -1166,9 +1166,9 @@  discard block
 block discarded – undo
1166 1166
             $hit['type'][] = $this->shortenUri($typeuri);
1167 1167
         }
1168 1168
 
1169
-        if(!empty($fields)) {
1169
+        if (!empty($fields)) {
1170 1170
             foreach ($fields as $prop) {
1171
-                $propname = $prop . 's';
1171
+                $propname = $prop.'s';
1172 1172
                 if (isset($row->$propname)) {
1173 1173
                     foreach (explode("\n", $row->$propname->getValue()) as $line) {
1174 1174
                         $rdata = str_getcsv($line, ',', '"', '"');
@@ -1183,7 +1183,7 @@  discard block
 block discarded – undo
1183 1183
                             $propvals = $rdata[2];
1184 1184
                         }
1185 1185
 
1186
-                        $hit['skos:' . $prop][] = $propvals;
1186
+                        $hit['skos:'.$prop][] = $propvals;
1187 1187
                     }
1188 1188
                 }
1189 1189
             }
@@ -1263,7 +1263,7 @@  discard block
 block discarded – undo
1263 1263
      * @return array query result object
1264 1264
      */
1265 1265
     public function queryConcepts($vocabs, $fields, $unique, $params, $showDeprecated = false) {
1266
-        $query = $this->generateConceptSearchQuery($fields, $unique, $params,$showDeprecated);
1266
+        $query = $this->generateConceptSearchQuery($fields, $unique, $params, $showDeprecated);
1267 1267
         $results = $this->query($query);
1268 1268
         return $this->transformConceptSearchResults($results, $vocabs, $fields);
1269 1269
     }
@@ -1318,10 +1318,10 @@  discard block
 block discarded – undo
1318 1318
         $conditions = $this->formatFilterConditions($letter, $lang);
1319 1319
         $filtercondLabel = $conditions['filterpref'];
1320 1320
         $filtercondALabel = $conditions['filteralt'];
1321
-        $qualifierClause = $qualifier ? "OPTIONAL { ?s <" . $qualifier->getURI() . "> ?qualifier }" : "";
1322
-        $filterDeprecated="";
1323
-        if(!$showDeprecated){
1324
-            $filterDeprecated="FILTER NOT EXISTS { ?s owl:deprecated true }";
1321
+        $qualifierClause = $qualifier ? "OPTIONAL { ?s <".$qualifier->getURI()."> ?qualifier }" : "";
1322
+        $filterDeprecated = "";
1323
+        if (!$showDeprecated) {
1324
+            $filterDeprecated = "FILTER NOT EXISTS { ?s owl:deprecated true }";
1325 1325
         }
1326 1326
         $query = <<<EOQ
1327 1327
 SELECT DISTINCT ?s ?label ?alabel ?qualifier
@@ -1798,7 +1798,7 @@  discard block
 block discarded – undo
1798 1798
                 if (!isset($row->label) || $row->label->getLang() === $lang) {
1799 1799
                     $ret[$row->object->getUri()] = $val;
1800 1800
                 } elseif ($row->label->getLang() === $fallbacklang) {
1801
-                    $val['label'] .= ' (' . $row->label->getLang() . ')';
1801
+                    $val['label'] .= ' ('.$row->label->getLang().')';
1802 1802
                     $ret[$row->object->getUri()] = $val;
1803 1803
                 }
1804 1804
             }
@@ -1894,10 +1894,10 @@  discard block
 block discarded – undo
1894 1894
 
1895 1895
             $label = null;
1896 1896
             if (isset($row->label)) {
1897
-                if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang . "-") == 0) {
1897
+                if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang."-") == 0) {
1898 1898
                     $label = $row->label->getValue();
1899 1899
                 } else {
1900
-                    $label = $row->label->getValue() . " (" . $row->label->getLang() . ")";
1900
+                    $label = $row->label->getValue()." (".$row->label->getLang().")";
1901 1901
                 }
1902 1902
 
1903 1903
             }
@@ -1973,8 +1973,8 @@  discard block
 block discarded – undo
1973 1973
         foreach ($result as $row) {
1974 1974
             if (isset($row->top) && isset($row->label)) {
1975 1975
                 $label = $row->label->getValue();
1976
-                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang . "-") !== 0) {
1977
-                    $label .= ' (' . $row->label->getLang() . ')';
1976
+                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang."-") !== 0) {
1977
+                    $label .= ' ('.$row->label->getLang().')';
1978 1978
                 }
1979 1979
                 $top = array('uri' => $row->top->getUri(), 'topConceptOf' => $row->topuri->getUri(), 'label' => $label, 'hasChildren' => filter_var($row->children->getValue(), FILTER_VALIDATE_BOOLEAN));
1980 1980
                 if (isset($row->notation)) {
@@ -2067,7 +2067,7 @@  discard block
 block discarded – undo
2067 2067
                 $ret[$uri]['exact'] = $row->exact->getUri();
2068 2068
             }
2069 2069
             if (isset($row->tops)) {
2070
-               $topConceptsList=explode(" ", $row->tops->getValue());
2070
+               $topConceptsList = explode(" ", $row->tops->getValue());
2071 2071
                // sort to guarantee an alphabetical ordering of the URI
2072 2072
                sort($topConceptsList);
2073 2073
                $ret[$uri]['tops'] = $topConceptsList;
@@ -2080,8 +2080,8 @@  discard block
 block discarded – undo
2080 2080
                 $label = null;
2081 2081
                 if (isset($row->childlabel)) {
2082 2082
                     $label = $row->childlabel->getValue();
2083
-                    if ($row->childlabel->getLang() !== $lang && strpos($row->childlabel->getLang(), $lang . "-") !== 0) {
2084
-                        $label .= " (" . $row->childlabel->getLang() . ")";
2083
+                    if ($row->childlabel->getLang() !== $lang && strpos($row->childlabel->getLang(), $lang."-") !== 0) {
2084
+                        $label .= " (".$row->childlabel->getLang().")";
2085 2085
                     }
2086 2086
 
2087 2087
                 }
@@ -2102,8 +2102,8 @@  discard block
 block discarded – undo
2102 2102
             }
2103 2103
             if (isset($row->label)) {
2104 2104
                 $preflabel = $row->label->getValue();
2105
-                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang . "-") !== 0) {
2106
-                    $preflabel .= ' (' . $row->label->getLang() . ')';
2105
+                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang."-") !== 0) {
2106
+                    $preflabel .= ' ('.$row->label->getLang().')';
2107 2107
                 }
2108 2108
 
2109 2109
                 $ret[$uri]['prefLabel'] = $preflabel;
@@ -2224,9 +2224,9 @@  discard block
 block discarded – undo
2224 2224
      */
2225 2225
     private function generateConceptGroupContentsQuery($groupClass, $group, $lang, $showDeprecated = false) {
2226 2226
         $fcl = $this->generateFromClause();
2227
-        $filterDeprecated="";
2228
-        if(!$showDeprecated){
2229
-            $filterDeprecated="  FILTER NOT EXISTS { ?conc owl:deprecated true }";
2227
+        $filterDeprecated = "";
2228
+        if (!$showDeprecated) {
2229
+            $filterDeprecated = "  FILTER NOT EXISTS { ?conc owl:deprecated true }";
2230 2230
         }
2231 2231
         $query = <<<EOQ
2232 2232
 SELECT ?conc ?super ?label ?members ?type ?notation $fcl
@@ -2265,10 +2265,10 @@  discard block
 block discarded – undo
2265 2265
                     'type' => array($row->type->shorten()),
2266 2266
                 );
2267 2267
                 if (isset($row->label)) {
2268
-                    if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang . "-") == 0) {
2268
+                    if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang."-") == 0) {
2269 2269
                         $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue();
2270 2270
                     } else {
2271
-                        $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue() . " (" . $row->label->getLang() . ")";
2271
+                        $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue()." (".$row->label->getLang().")";
2272 2272
                     }
2273 2273
 
2274 2274
                 }
@@ -2296,8 +2296,8 @@  discard block
 block discarded – undo
2296 2296
      * @param boolean $showDeprecated whether to include deprecated concepts in search results
2297 2297
      * @return array Result array with concept URI as key and concept label as value
2298 2298
      */
2299
-    public function listConceptGroupContents($groupClass, $group, $lang,$showDeprecated = false) {
2300
-        $query = $this->generateConceptGroupContentsQuery($groupClass, $group, $lang,$showDeprecated);
2299
+    public function listConceptGroupContents($groupClass, $group, $lang, $showDeprecated = false) {
2300
+        $query = $this->generateConceptGroupContentsQuery($groupClass, $group, $lang, $showDeprecated);
2301 2301
         $result = $this->query($query);
2302 2302
         return $this->transformConceptGroupContentsResults($result, $lang);
2303 2303
     }
@@ -2311,9 +2311,9 @@  discard block
 block discarded – undo
2311 2311
      * @param boolean $showDeprecated whether to include deprecated concepts in the change list
2312 2312
      * @return string sparql query
2313 2313
      */
2314
-    private function generateChangeListQuery($prop, $lang, $offset, $limit=200, $showDeprecated=false) {
2314
+    private function generateChangeListQuery($prop, $lang, $offset, $limit = 200, $showDeprecated = false) {
2315 2315
         $fcl = $this->generateFromClause();
2316
-        $offset = ($offset) ? 'OFFSET ' . $offset : '';
2316
+        $offset = ($offset) ? 'OFFSET '.$offset : '';
2317 2317
 
2318 2318
         //Additional clauses when deprecated concepts need to be included in the results
2319 2319
         $deprecatedOptions = '';
@@ -2403,7 +2403,7 @@  discard block
 block discarded – undo
2403 2403
      * @param boolean $showDeprecated whether to include deprecated concepts in the change list
2404 2404
      * @return array Result array
2405 2405
      */
2406
-    public function queryChangeList($prop, $lang, $offset, $limit, $showDeprecated=false) {
2406
+    public function queryChangeList($prop, $lang, $offset, $limit, $showDeprecated = false) {
2407 2407
         $query = $this->generateChangeListQuery($prop, $lang, $offset, $limit, $showDeprecated);
2408 2408
 
2409 2409
         $result = $this->query($query);
Please login to merge, or discard this patch.