Passed
Pull Request — master (#1165)
by
unknown
03:04
created
controller/RestController.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -575,9 +575,9 @@  discard block
 block discarded – undo
575 575
                 $vocid = $request->getVocab()->getId();
576 576
                 return $this->returnError('404', 'Not Found', "No download source URL known for vocabulary $vocid in language $dataLang");
577 577
             }
578
-		} else {
578
+    } else {
579 579
             header("Location: " . $urls[$format]);
580
-		}
580
+    }
581 581
     }
582 582
 
583 583
     private function returnDataResults($results, $format) {
@@ -1120,9 +1120,9 @@  discard block
 block discarded – undo
1120 1120
         }
1121 1121
         return $this->returnJson(array_merge_recursive($this->context,
1122 1122
                                                         array('@context' => array( '@language' => $request->getLang(),
1123
-                                                                                     'prefLabel' => 'skos:prefLabel',
1124
-                                                                                     'xsd' => 'http://www.w3.org/2001/XMLSchema#',
1125
-                                                                                     'date' => array( '@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime') )
1123
+                                                                                      'prefLabel' => 'skos:prefLabel',
1124
+                                                                                      'xsd' => 'http://www.w3.org/2001/XMLSchema#',
1125
+                                                                                      'date' => array( '@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime') )
1126 1126
                                                         ),
1127 1127
                                                         array('changeList' => $simpleChangeList)));
1128 1128
 
Please login to merge, or discard this 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_STRING)) {
27 27
             header("Content-type: application/javascript; charset=utf-8");
28
-            echo filter_input(INPUT_GET, 'callback', FILTER_UNSAFE_RAW) . "(" . json_encode($data) . ");";
28
+            echo filter_input(INPUT_GET, 'callback', FILTER_UNSAFE_RAW)."(".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
             }
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
                 'prefLabel' => 'skos:prefLabel',
230 230
                 'title' => 'dct:title',
231 231
                 '@language' => $request->getLang(),
232
-                '@base' => $this->getBaseHref() . "rest/v1/" . $vocab->getId() . "/",
232
+                '@base' => $this->getBaseHref()."rest/v1/".$vocab->getId()."/",
233 233
             ),
234 234
             'uri' => '',
235 235
             'id' => $vocab->getId(),
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
                 'subTypes' => array('@id' => 'void:class', '@type' => '@id'),
285 285
                 'count' => 'void:entities',
286 286
                 '@language' => $request->getLang(),
287
-                '@base' => $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/",
287
+                '@base' => $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/",
288 288
             ),
289 289
             'uri' => '',
290 290
             'id' => $request->getVocab()->getId(),
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
                 'language' => 'void-ext:language',
367 367
                 'properties' => 'void:propertyPartition',
368 368
                 'labels' => 'void:triples',
369
-                '@base' => $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/",
369
+                '@base' => $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/",
370 370
             ),
371 371
             'uri' => '',
372 372
             'id' => $request->getVocab()->getId(),
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
             $types[] = $type;
408 408
         }
409 409
 
410
-        $base = $request->getVocab() ? $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/" : $this->getBaseHref() . "rest/v1/";
410
+        $base = $request->getVocab() ? $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/" : $this->getBaseHref()."rest/v1/";
411 411
 
412 412
         $ret = array_merge_recursive($this->context, array(
413 413
             '@context' => array(
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
         if ($lang === null) {
449 449
             // case 1A: exact match on preferred label in any language
450 450
             foreach ($results as $res) {
451
-                if (isset($res['matchedPrefLabel']) && $res['matchedPrefLabel']  == $label) {
451
+                if (isset($res['matchedPrefLabel']) && $res['matchedPrefLabel'] == $label) {
452 452
                     $res['prefLabel'] = $res['matchedPrefLabel'];
453 453
                     unset($res['matchedPrefLabel']);
454 454
                     $hits[] = $res;
@@ -570,19 +570,19 @@  discard block
 block discarded – undo
570 570
 
571 571
         $format = $this->negotiateFormat(array_keys($urls), $request->getServerConstant('HTTP_ACCEPT'), $request->getQueryParam('format'));
572 572
         if (!$format) {
573
-            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: " . implode(' ', array_keys($urls)));
573
+            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: ".implode(' ', array_keys($urls)));
574 574
         }
575 575
         if (is_array($urls[$format])) {
576 576
             $arr = $urls[$format];
577 577
             $dataLang = $request->getLang();
578 578
             if (isset($arr[$dataLang])) {
579
-                header("Location: " . $arr[$dataLang]);
579
+                header("Location: ".$arr[$dataLang]);
580 580
             } else {
581 581
                 $vocid = $request->getVocab()->getId();
582 582
                 return $this->returnError('404', 'Not Found', "No download source URL known for vocabulary $vocid in language $dataLang");
583 583
             }
584 584
 		} else {
585
-            header("Location: " . $urls[$format]);
585
+            header("Location: ".$urls[$format]);
586 586
 		}
587 587
     }
588 588
 
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
 
646 646
         $format = $this->negotiateFormat(explode(' ', self::SUPPORTED_FORMATS), $request->getServerConstant('HTTP_ACCEPT'), $request->getQueryParam('format'));
647 647
         if (!$format) {
648
-            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: " . self::SUPPORTED_FORMATS);
648
+            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: ".self::SUPPORTED_FORMATS);
649 649
         }
650 650
 
651 651
         $vocid = $vocab ? $vocab->getId() : null;
@@ -930,7 +930,7 @@  discard block
 block discarded – undo
930 930
                         }
931 931
                     }
932 932
                     // if the main concept scheme was not found, set 'top' to the first 'tops' (sorted alphabetically on the URIs)
933
-                    if (! isset($results[$uri]['top'])) {
933
+                    if (!isset($results[$uri]['top'])) {
934 934
                         $results[$uri]['top'] = $results[$uri]['tops'][0];
935 935
                     }
936 936
                 } else {
@@ -1108,7 +1108,7 @@  discard block
 block discarded – undo
1108 1108
         $changeList = $request->getVocab()->getChangeList($prop, $request->getLang(), $offset, $limit);
1109 1109
 
1110 1110
         $simpleChangeList = array();
1111
-        foreach($changeList as $conceptInfo) {
1111
+        foreach ($changeList as $conceptInfo) {
1112 1112
             if (array_key_exists('date', $conceptInfo)) {
1113 1113
                 $concept = array(
1114 1114
                     'uri' => $conceptInfo['uri'],
@@ -1124,10 +1124,10 @@  discard block
 block discarded – undo
1124 1124
             }
1125 1125
         }
1126 1126
         return $this->returnJson(array_merge_recursive($this->context,
1127
-                                                        array('@context' => array( '@language' => $request->getLang(),
1127
+                                                        array('@context' => array('@language' => $request->getLang(),
1128 1128
                                                                                      'prefLabel' => 'skos:prefLabel',
1129 1129
                                                                                      'xsd' => 'http://www.w3.org/2001/XMLSchema#',
1130
-                                                                                     'date' => array( '@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime') )
1130
+                                                                                     'date' => array('@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime'))
1131 1131
                                                         ),
1132 1132
                                                         array('changeList' => $simpleChangeList)));
1133 1133
 
Please login to merge, or discard this patch.
model/sparql/GenericSparql.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
     protected function query($query) {
89 89
         $queryId = sprintf("%05d", rand(0, 99999));
90 90
         $logger = $this->model->getLogger();
91
-        $logger->info("[qid $queryId] SPARQL query:\n" . $this->generateQueryPrefixes($query) . "\n$query\n");
91
+        $logger->info("[qid $queryId] SPARQL query:\n".$this->generateQueryPrefixes($query)."\n$query\n");
92 92
         $starttime = microtime(true);
93 93
         $result = $this->client->query($query);
94 94
         $elapsed = intval(round((microtime(true) - $starttime) * 1000));
95
-        if(method_exists($result, 'numRows')) {
95
+        if (method_exists($result, 'numRows')) {
96 96
             $numRows = $result->numRows();
97 97
             $logger->info("[qid $queryId] result: $numRows rows returned in $elapsed ms");
98 98
         } else { // graph result
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      * @param Vocabulary[]|null $vocabs
109 109
      * @return string
110 110
      */
111
-    protected function generateFromClause($vocabs=null) {
111
+    protected function generateFromClause($vocabs = null) {
112 112
         $clause = '';
113 113
         if (!$vocabs) {
114 114
             return $this->graph !== '?graph' && $this->graph !== NULL ? "FROM <$this->graph>" : '';
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 
249 249
 	$quote_string = function($val) { return "'$val'"; };
250 250
 	$quoted_values = array_map($quote_string, $langs);
251
-	$langFilter = "FILTER(?lang IN (" . implode(',', $quoted_values) . "))";
251
+	$langFilter = "FILTER(?lang IN (".implode(',', $quoted_values)."))";
252 252
 
253 253
         $values = $this->formatValues('?type', $classes, 'uri');
254 254
         $valuesProp = $this->formatValues('?prop', $props, null);
@@ -685,9 +685,9 @@  discard block
 block discarded – undo
685 685
                 $conceptscheme['title'] = $row->title->getValue();
686 686
             }
687 687
             // add dct:subject and their labels in the result
688
-            if(isset($row->domain) && isset($row->domainLabel)){
689
-                $conceptscheme['subject']['uri']=$row->domain->getURI();
690
-                $conceptscheme['subject']['prefLabel']=$row->domainLabel->getValue();
688
+            if (isset($row->domain) && isset($row->domainLabel)) {
689
+                $conceptscheme['subject']['uri'] = $row->domain->getURI();
690
+                $conceptscheme['subject']['prefLabel'] = $row->domainLabel->getValue();
691 691
             }
692 692
 
693 693
             $ret[$row->cs->getURI()] = $conceptscheme;
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
           $values[] = "<$graph>";
755 755
         }
756 756
         if (count($values)) {
757
-          return "FILTER (?graph IN (" . implode(',', $values) . "))";
757
+          return "FILTER (?graph IN (".implode(',', $values)."))";
758 758
         }
759 759
     }
760 760
 
@@ -765,16 +765,16 @@  discard block
 block discarded – undo
765 765
      * @return string sparql query clauses
766 766
      */
767 767
     protected function formatLimitAndOffset($limit, $offset) {
768
-        $limit = ($limit) ? 'LIMIT ' . $limit : '';
769
-        $offset = ($offset) ? 'OFFSET ' . $offset : '';
768
+        $limit = ($limit) ? 'LIMIT '.$limit : '';
769
+        $offset = ($offset) ? 'OFFSET '.$offset : '';
770 770
         // eliminating whitespace and line changes when the conditions aren't needed.
771 771
         $limitandoffset = '';
772 772
         if ($limit && $offset) {
773
-            $limitandoffset = "\n" . $limit . "\n" . $offset;
773
+            $limitandoffset = "\n".$limit."\n".$offset;
774 774
         } elseif ($limit) {
775
-            $limitandoffset = "\n" . $limit;
775
+            $limitandoffset = "\n".$limit;
776 776
         } elseif ($offset) {
777
-            $limitandoffset = "\n" . $offset;
777
+            $limitandoffset = "\n".$offset;
778 778
         }
779 779
 
780 780
         return $limitandoffset;
@@ -926,14 +926,14 @@  discard block
 block discarded – undo
926 926
         // if search language and UI/display language differ, must also consider case where there is no prefLabel in
927 927
         // the display language; in that case, should use the label with the same language as the matched label
928 928
         $labelcondFallback = ($searchLang != $lang) ?
929
-          "OPTIONAL { # in case previous OPTIONAL block gives no labels\n" .
929
+          "OPTIONAL { # in case previous OPTIONAL block gives no labels\n".
930 930
           "?s skos:prefLabel ?label . FILTER (LANGMATCHES(LANG(?label), LANG(?match))) }" : "";
931 931
 
932 932
         //  Including the labels if there is no query term given.
933 933
         if ($rawterm === '') {
934 934
           $labelClause = "?s skos:prefLabel ?label .";
935
-          $labelClause = ($lang) ? $labelClause . " FILTER (LANGMATCHES(LANG(?label), '$lang'))" : $labelClause . "";
936
-          return $labelClause . " BIND(?label AS ?match)";
935
+          $labelClause = ($lang) ? $labelClause." FILTER (LANGMATCHES(LANG(?label), '$lang'))" : $labelClause."";
936
+          return $labelClause." BIND(?label AS ?match)";
937 937
         }
938 938
 
939 939
         /*
@@ -1005,20 +1005,20 @@  discard block
 block discarded – undo
1005 1005
         $schemecond = '';
1006 1006
         if (!empty($schemes)) {
1007 1007
             $conditions = array();
1008
-            foreach($schemes as $scheme) {
1008
+            foreach ($schemes as $scheme) {
1009 1009
                 $conditions[] = "{?s skos:inScheme <$scheme>}";
1010 1010
             }
1011
-            $schemecond = '{'.implode(" UNION ",$conditions).'}';
1011
+            $schemecond = '{'.implode(" UNION ", $conditions).'}';
1012 1012
         }
1013
-        $filterDeprecated="";
1013
+        $filterDeprecated = "";
1014 1014
         //show or hide deprecated concepts
1015
-        if(!$showDeprecated){
1016
-            $filterDeprecated="FILTER NOT EXISTS { ?s owl:deprecated true }";
1015
+        if (!$showDeprecated) {
1016
+            $filterDeprecated = "FILTER NOT EXISTS { ?s owl:deprecated true }";
1017 1017
         }
1018 1018
         // extra conditions for parent and group, if specified
1019
-        $parentcond = ($params->getParentLimit()) ? "?s skos:broader+ <" . $params->getParentLimit() . "> ." : "";
1020
-        $groupcond = ($params->getGroupLimit()) ? "<" . $params->getGroupLimit() . "> skos:member ?s ." : "";
1021
-        $pgcond = $parentcond . $groupcond;
1019
+        $parentcond = ($params->getParentLimit()) ? "?s skos:broader+ <".$params->getParentLimit()."> ." : "";
1020
+        $groupcond = ($params->getGroupLimit()) ? "<".$params->getGroupLimit()."> skos:member ?s ." : "";
1021
+        $pgcond = $parentcond.$groupcond;
1022 1022
 
1023 1023
         $orderextra = $this->isDefaultEndpoint() ? $this->graph : '';
1024 1024
 
@@ -1104,9 +1104,9 @@  discard block
 block discarded – undo
1104 1104
             $hit['type'][] = $this->shortenUri($typeuri);
1105 1105
         }
1106 1106
 
1107
-        if(!empty($fields)) {
1107
+        if (!empty($fields)) {
1108 1108
             foreach ($fields as $prop) {
1109
-                $propname = $prop . 's';
1109
+                $propname = $prop.'s';
1110 1110
                 if (isset($row->$propname)) {
1111 1111
                     foreach (explode("\n", $row->$propname->getValue()) as $line) {
1112 1112
                         $rdata = str_getcsv($line, ',', '"', '"');
@@ -1121,7 +1121,7 @@  discard block
 block discarded – undo
1121 1121
                             $propvals = $rdata[2];
1122 1122
                         }
1123 1123
 
1124
-                        $hit['skos:' . $prop][] = $propvals;
1124
+                        $hit['skos:'.$prop][] = $propvals;
1125 1125
                     }
1126 1126
                 }
1127 1127
             }
@@ -1197,7 +1197,7 @@  discard block
 block discarded – undo
1197 1197
      * @return array query result object
1198 1198
      */
1199 1199
     public function queryConcepts($vocabs, $fields = null, $unique = false, $params, $showDeprecated = false) {
1200
-        $query = $this->generateConceptSearchQuery($fields, $unique, $params,$showDeprecated);
1200
+        $query = $this->generateConceptSearchQuery($fields, $unique, $params, $showDeprecated);
1201 1201
         $results = $this->query($query);
1202 1202
         return $this->transformConceptSearchResults($results, $vocabs, $fields);
1203 1203
     }
@@ -1252,10 +1252,10 @@  discard block
 block discarded – undo
1252 1252
         $conditions = $this->formatFilterConditions($letter, $lang);
1253 1253
         $filtercondLabel = $conditions['filterpref'];
1254 1254
         $filtercondALabel = $conditions['filteralt'];
1255
-        $qualifierClause = $qualifier ? "OPTIONAL { ?s <" . $qualifier->getURI() . "> ?qualifier }" : "";
1256
-        $filterDeprecated="";
1257
-        if(!$showDeprecated){
1258
-            $filterDeprecated="FILTER NOT EXISTS { ?s owl:deprecated true }";
1255
+        $qualifierClause = $qualifier ? "OPTIONAL { ?s <".$qualifier->getURI()."> ?qualifier }" : "";
1256
+        $filterDeprecated = "";
1257
+        if (!$showDeprecated) {
1258
+            $filterDeprecated = "FILTER NOT EXISTS { ?s owl:deprecated true }";
1259 1259
         }
1260 1260
         $query = <<<EOQ
1261 1261
 SELECT DISTINCT ?s ?label ?alabel ?qualifier
@@ -1732,7 +1732,7 @@  discard block
 block discarded – undo
1732 1732
                 if (!isset($row->label) || $row->label->getLang() === $lang) {
1733 1733
                     $ret[$row->object->getUri()] = $val;
1734 1734
                 } elseif ($row->label->getLang() === $fallbacklang) {
1735
-                    $val['label'] .= ' (' . $row->label->getLang() . ')';
1735
+                    $val['label'] .= ' ('.$row->label->getLang().')';
1736 1736
                     $ret[$row->object->getUri()] = $val;
1737 1737
                 }
1738 1738
             }
@@ -1828,10 +1828,10 @@  discard block
 block discarded – undo
1828 1828
 
1829 1829
             $label = null;
1830 1830
             if (isset($row->label)) {
1831
-                if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang . "-") == 0) {
1831
+                if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang."-") == 0) {
1832 1832
                     $label = $row->label->getValue();
1833 1833
                 } else {
1834
-                    $label = $row->label->getValue() . " (" . $row->label->getLang() . ")";
1834
+                    $label = $row->label->getValue()." (".$row->label->getLang().")";
1835 1835
                 }
1836 1836
 
1837 1837
             }
@@ -1907,8 +1907,8 @@  discard block
 block discarded – undo
1907 1907
         foreach ($result as $row) {
1908 1908
             if (isset($row->top) && isset($row->label)) {
1909 1909
                 $label = $row->label->getValue();
1910
-                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang . "-") !== 0) {
1911
-                    $label .= ' (' . $row->label->getLang() . ')';
1910
+                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang."-") !== 0) {
1911
+                    $label .= ' ('.$row->label->getLang().')';
1912 1912
                 }
1913 1913
                 $top = array('uri' => $row->top->getUri(), 'topConceptOf' => $row->topuri->getUri(), 'label' => $label, 'hasChildren' => filter_var($row->children->getValue(), FILTER_VALIDATE_BOOLEAN));
1914 1914
                 if (isset($row->notation)) {
@@ -2001,7 +2001,7 @@  discard block
 block discarded – undo
2001 2001
                 $ret[$uri]['exact'] = $row->exact->getUri();
2002 2002
             }
2003 2003
             if (isset($row->tops)) {
2004
-               $topConceptsList=explode(" ", $row->tops->getValue());
2004
+               $topConceptsList = explode(" ", $row->tops->getValue());
2005 2005
                // sort to guarantee an alphabetical ordering of the URI
2006 2006
                sort($topConceptsList);
2007 2007
                $ret[$uri]['tops'] = $topConceptsList;
@@ -2014,8 +2014,8 @@  discard block
 block discarded – undo
2014 2014
                 $label = null;
2015 2015
                 if (isset($row->childlabel)) {
2016 2016
                     $label = $row->childlabel->getValue();
2017
-                    if ($row->childlabel->getLang() !== $lang && strpos($row->childlabel->getLang(), $lang . "-") !== 0) {
2018
-                        $label .= " (" . $row->childlabel->getLang() . ")";
2017
+                    if ($row->childlabel->getLang() !== $lang && strpos($row->childlabel->getLang(), $lang."-") !== 0) {
2018
+                        $label .= " (".$row->childlabel->getLang().")";
2019 2019
                     }
2020 2020
 
2021 2021
                 }
@@ -2036,8 +2036,8 @@  discard block
 block discarded – undo
2036 2036
             }
2037 2037
             if (isset($row->label)) {
2038 2038
                 $preflabel = $row->label->getValue();
2039
-                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang . "-") !== 0) {
2040
-                    $preflabel .= ' (' . $row->label->getLang() . ')';
2039
+                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang."-") !== 0) {
2040
+                    $preflabel .= ' ('.$row->label->getLang().')';
2041 2041
                 }
2042 2042
 
2043 2043
                 $ret[$uri]['prefLabel'] = $preflabel;
@@ -2158,9 +2158,9 @@  discard block
 block discarded – undo
2158 2158
      */
2159 2159
     private function generateConceptGroupContentsQuery($groupClass, $group, $lang, $showDeprecated = false) {
2160 2160
         $fcl = $this->generateFromClause();
2161
-        $filterDeprecated="";
2162
-        if(!$showDeprecated){
2163
-            $filterDeprecated="  FILTER NOT EXISTS { ?conc owl:deprecated true }";
2161
+        $filterDeprecated = "";
2162
+        if (!$showDeprecated) {
2163
+            $filterDeprecated = "  FILTER NOT EXISTS { ?conc owl:deprecated true }";
2164 2164
         }
2165 2165
         $query = <<<EOQ
2166 2166
 SELECT ?conc ?super ?label ?members ?type ?notation $fcl
@@ -2199,10 +2199,10 @@  discard block
 block discarded – undo
2199 2199
                     'type' => array($row->type->shorten()),
2200 2200
                 );
2201 2201
                 if (isset($row->label)) {
2202
-                    if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang . "-") == 0) {
2202
+                    if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang."-") == 0) {
2203 2203
                         $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue();
2204 2204
                     } else {
2205
-                        $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue() . " (" . $row->label->getLang() . ")";
2205
+                        $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue()." (".$row->label->getLang().")";
2206 2206
                     }
2207 2207
 
2208 2208
                 }
@@ -2230,8 +2230,8 @@  discard block
 block discarded – undo
2230 2230
      * @param boolean $showDeprecated whether to include deprecated concepts in search results
2231 2231
      * @return array Result array with concept URI as key and concept label as value
2232 2232
      */
2233
-    public function listConceptGroupContents($groupClass, $group, $lang,$showDeprecated = false) {
2234
-        $query = $this->generateConceptGroupContentsQuery($groupClass, $group, $lang,$showDeprecated);
2233
+    public function listConceptGroupContents($groupClass, $group, $lang, $showDeprecated = false) {
2234
+        $query = $this->generateConceptGroupContentsQuery($groupClass, $group, $lang, $showDeprecated);
2235 2235
         $result = $this->query($query);
2236 2236
         return $this->transformConceptGroupContentsResults($result, $lang);
2237 2237
     }
@@ -2245,9 +2245,9 @@  discard block
 block discarded – undo
2245 2245
      * @param boolean $showDeprecated whether to include deprecated concepts in the change list
2246 2246
      * @return string sparql query
2247 2247
      */
2248
-    private function generateChangeListQuery($prop, $lang, $offset, $limit=200, $showDeprecated=false) {
2248
+    private function generateChangeListQuery($prop, $lang, $offset, $limit = 200, $showDeprecated = false) {
2249 2249
         $fcl = $this->generateFromClause();
2250
-        $offset = ($offset) ? 'OFFSET ' . $offset : '';
2250
+        $offset = ($offset) ? 'OFFSET '.$offset : '';
2251 2251
 
2252 2252
         //Additional clauses when deprecated concepts need to be included in the results
2253 2253
         $deprecatedOptions = '';
@@ -2325,7 +2325,7 @@  discard block
 block discarded – undo
2325 2325
      * @param boolean $showDeprecated whether to include deprecated concepts in the change list
2326 2326
      * @return array Result array
2327 2327
      */
2328
-    public function queryChangeList($prop, $lang, $offset, $limit, $showDeprecated=false) {
2328
+    public function queryChangeList($prop, $lang, $offset, $limit, $showDeprecated = false) {
2329 2329
         $query = $this->generateChangeListQuery($prop, $lang, $offset, $limit, $showDeprecated);
2330 2330
 
2331 2331
         $result = $this->query($query);
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
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             return $lname;
103 103
         }
104 104
         // already a full URI
105
-        return $this->getUriSpace() . $lname;
105
+        return $this->getUriSpace().$lname;
106 106
     }
107 107
 
108 108
     /**
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
             $result = $sparql->queryConceptScheme($defaultcs);
165 165
         } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) {
166 166
              if ($this->model->getConfig()->getLogCaughtExceptions()) {
167
-                 error_log('Caught exception: ' . $e->getMessage());
167
+                 error_log('Caught exception: '.$e->getMessage());
168 168
              }
169 169
              return null;
170 170
         }
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
                 foreach ($conceptscheme->allLiterals($prop, null) as $val) {
198 198
                     $prop = (substr($prop, 0, 5) == 'dc11:') ? str_replace('dc11:', 'dc:', $prop) : $prop;
199 199
                     if ($val->getValue() instanceof DateTime) {
200
-                        $val = Punic\Calendar::formatDate($val->getValue(), 'full', $lang) . ' ' . Punic\Calendar::format($val->getValue(), 'HH:mm:ss', $lang);
200
+                        $val = Punic\Calendar::formatDate($val->getValue(), 'full', $lang).' '.Punic\Calendar::format($val->getValue(), 'HH:mm:ss', $lang);
201 201
                     }
202 202
                     $ret[$prop][] = $val;
203 203
                 }
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
             $conceptSchemes = $this->getSparql()->queryConceptSchemes($lang);
255 255
         } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) {
256 256
              if ($this->model->getConfig()->getLogCaughtExceptions()) {
257
-                 error_log('Caught exception: ' . $e->getMessage());
257
+                 error_log('Caught exception: '.$e->getMessage());
258 258
              }
259 259
         }
260 260
         return $conceptSchemes;
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
         }
326 326
         // don't know how to parse
327 327
         $rev = $parts[2];
328
-        $datestr = $parts[3] . ' ' . $parts[4];
328
+        $datestr = $parts[3].' '.$parts[4];
329 329
 
330 330
         return "$datestr (r$rev)";
331 331
     }
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
      * @param string $array the uri of the concept array class, eg. isothes:ThesaurusArray
337 337
      * @param string $group the uri of the  concept group class, eg. isothes:ConceptGroup
338 338
      */
339
-    public function getStatistics($lang = '', $array=null, $group=null)
339
+    public function getStatistics($lang = '', $array = null, $group = null)
340 340
     {
341 341
         $sparql = $this->getSparql();
342 342
         // find the number of concepts
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
             $conceptInfo = $sparql->queryConceptInfo($uri, $this->config->getArrayClassURI(), array($this), $clang);
455 455
         } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) {
456 456
              if ($this->model->getConfig()->getLogCaughtExceptions()) {
457
-                 error_log('Caught exception: ' . $e->getMessage());
457
+                 error_log('Caught exception: '.$e->getMessage());
458 458
              }
459 459
         }
460 460
         return $conceptInfo;
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
         return $this->getSparql()->queryChangeList($prop, $clang, $offset, $limit, $showDeprecated);
666 666
     }
667 667
 
668
-    public function getTitle($lang=null) {
668
+    public function getTitle($lang = null) {
669 669
       return $this->config->getTitle($lang);
670 670
     }
671 671
 
Please login to merge, or discard this patch.