Completed
Pull Request — master (#1022)
by
unknown
01:57
created
model/ConceptProperty.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      * @param string $super URI of superproperty
28 28
      * @param boolean $sort_by_notation whether to sort the property values by their notation code
29 29
      */
30
-    public function __construct($prop, $label, $tooltip=null, $super=null, $sort_by_notation=false)
30
+    public function __construct($prop, $label, $tooltip = null, $super = null, $sort_by_notation = false)
31 31
     {
32 32
         $this->prop = $prop;
33 33
         $this->label = $label;
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     public function getDescription()
69 69
     {
70
-        $helpprop = $this->prop . "_help";
70
+        $helpprop = $this->prop."_help";
71 71
 
72 72
         // see if we have a translation with the help text
73 73
         $help = gettext($helpprop);
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
     public function addValue($value)
100 100
     {
101
-        $this->values[ltrim($value->getNotation() . ' ') . $value->getLabel() . rtrim(' ' . $value->getUri())] = $value;
101
+        $this->values[ltrim($value->getNotation().' ').$value->getLabel().rtrim(' '.$value->getUri())] = $value;
102 102
         $this->is_sorted = false;
103 103
     }
104 104
 
Please login to merge, or discard this patch.
model/ConceptMappingPropertyValue.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
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()
@@ -180,25 +180,25 @@  discard block
 block discarded – undo
180 180
             'from' => [
181 181
                 'memberSet' => [
182 182
                     [
183
-                        'uri' => (string) $this->source->getUri(),
183
+                        'uri' => (string)$this->source->getUri(),
184 184
                     ]
185 185
                 ]
186 186
             ],
187 187
             'to' => [
188 188
                 'memberSet' => [
189 189
                     [
190
-                        'uri' => (string) $this->getUri()
190
+                        'uri' => (string)$this->getUri()
191 191
                     ]
192 192
                 ]
193 193
             ],
194 194
             // EXTRA
195 195
             'hrefLink' => $hrefLink, // link to resource as displayed in the UI
196 196
             'lang' => $propertyLang, // TBD: could it be part of the prefLabel?
197
-            'vocabName' => (string) $this->getVocabName(), // vocabulary as displayed in the UI
197
+            'vocabName' => (string)$this->getVocabName(), // vocabulary as displayed in the UI
198 198
             'typeLabel' => gettext($this->type), // a text used in the UI instead of, for example, skos:closeMatch
199 199
         ];
200 200
 
201
-        $helpprop = $this->type . "_help";
201
+        $helpprop = $this->type."_help";
202 202
         // see if we have a translation for the property help text
203 203
         $help = gettext($helpprop);
204 204
         if ($help != $helpprop) {
@@ -208,20 +208,20 @@  discard block
 block discarded – undo
208 208
         $fromScheme = $this->vocab->getDefaultConceptScheme();
209 209
         if (isset($fromScheme)) {
210 210
             $ret['fromScheme'] = [
211
-                'uri' => (string) $fromScheme,
211
+                'uri' => (string)$fromScheme,
212 212
             ];
213 213
         }
214 214
 
215 215
         $exvocab = $this->getExvocab();
216 216
         if (isset($exvocab)) {
217 217
             $ret['toScheme'] = [
218
-                'uri' => (string) $exvocab->getDefaultConceptScheme(),
218
+                'uri' => (string)$exvocab->getDefaultConceptScheme(),
219 219
             ];
220 220
         }
221 221
 
222 222
         $notation = $this->getNotation();
223 223
         if (isset($notation)) {
224
-            $ret['to']['memberSet'][0]['notation'] = (string) $notation;
224
+            $ret['to']['memberSet'][0]['notation'] = (string)$notation;
225 225
         }
226 226
 
227 227
         $label = $this->getLabel($lang, $queryExVocabs);
Please login to merge, or discard this patch.
model/Concept.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -136,9 +136,9 @@  discard block
 block discarded – undo
136 136
                 return $this->resource->label($fallback);
137 137
             }
138 138
             // We need to check all the labels in case one of them matches a subtag of the current language
139
-            foreach($this->resource->allLiterals('skos:prefLabel') as $label) {
139
+            foreach ($this->resource->allLiterals('skos:prefLabel') as $label) {
140 140
                 // the label lang code is a subtag of the UI lang eg. en-GB - create a new literal with the main language
141
-                if ($label !== null && strpos($label->getLang(), $fallback . '-') === 0) {
141
+                if ($label !== null && strpos($label->getLang(), $fallback.'-') === 0) {
142 142
                     return EasyRdf\Literal::create($label, $fallback);
143 143
                 }
144 144
             }
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 
160 160
     public function hasXlLabel($prop = 'prefLabel')
161 161
     {
162
-        if ($this->resource->hasProperty('skosxl:' . $prop)) {
162
+        if ($this->resource->hasProperty('skosxl:'.$prop)) {
163 163
             return true;
164 164
         }
165 165
         return false;
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     public function getXlLabel()
169 169
     {
170 170
         $labels = $this->resource->allResources('skosxl:prefLabel');
171
-        foreach($labels as $labres) {
171
+        foreach ($labels as $labres) {
172 172
             $label = $labres->getLiteral('skosxl:literalForm');
173 173
             if ($label !== null && $label->getLang() == $this->clang) {
174 174
                 return new LabelSkosXL($this->model, $labres);
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
         // catch external subjects that have $res as object
276 276
         $extSubjects = $exGraph->resourcesMatching("schema:about", $res);
277 277
 
278
-        $propList =  array_unique(array_merge(
278
+        $propList = array_unique(array_merge(
279 279
             $this->DEFAULT_EXT_PROPERTIES,
280 280
             $this->getVocab()->getConfig()->getExtProperties(),
281 281
             $this->getVocab()->getConfig()->getPlugins()->getExtProperties()
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
      * @param string[] $seen Processed resources so far
301 301
      * @param string[] $props (optional) limit to these property URIs
302 302
      */
303
-    private function addExternalTriplesToGraph($res, &$seen, $props=null)
303
+    private function addExternalTriplesToGraph($res, &$seen, $props = null)
304 304
     {
305 305
         if (array_key_exists($res->getUri(), $seen) && $seen[$res->getUri()] === 0) {
306 306
             return;
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
      */
331 331
     private function addPropertyValues($res, $prop, &$seen)
332 332
     {
333
-        $resList = $res->allResources('<' . $prop . '>');
333
+        $resList = $res->allResources('<'.$prop.'>');
334 334
 
335 335
         foreach ($resList as $res2) {
336 336
             if ($res2->isBNode()) {
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
             $this->addResourceReifications($res, $prop, $res2, $seen);
341 341
         }
342 342
 
343
-        $litList = $res->allLiterals('<' . $prop . '>');
343
+        $litList = $res->allLiterals('<'.$prop.'>');
344 344
 
345 345
         foreach ($litList as $lit) {
346 346
             $this->graph->addLiteral($res, $prop, $lit);
@@ -528,15 +528,15 @@  discard block
 block discarded – undo
528 528
                 // if not found in current vocabulary, look up in the default graph to be able
529 529
                 // to read an ontology loaded in a separate graph
530 530
                 // note that this imply that the property has an rdf:type declared for the query to work
531
-                if(!$is_well_known && !$proplabel) {
531
+                if (!$is_well_known && !$proplabel) {
532 532
                     $envLangLabels = $this->model->getDefaultSparql()->queryLabel($longUri, $this->getEnvLang());
533 533
                     
534 534
                     $defaultPropLabel = $this->model->getDefaultSparql()->queryLabel($longUri, '');
535 535
 
536
-					if($envLangLabels) {
536
+					if ($envLangLabels) {
537 537
 						$proplabel = $envLangLabels[$this->getEnvLang()];
538 538
                     } else {
539
-						if($defaultPropLabel) {
539
+						if ($defaultPropLabel) {
540 540
 							$proplabel = $defaultPropLabel[''];
541 541
 						}
542 542
 					}
@@ -549,12 +549,12 @@  discard block
 block discarded – undo
549 549
                 }
550 550
 
551 551
                 // also look up superprops in the default graph if not found in current vocabulary
552
-                if(!$is_well_known && (!$superprops || empty($superprops))) {
552
+                if (!$is_well_known && (!$superprops || empty($superprops))) {
553 553
                     $superprops = $this->model->getDefaultSparql()->querySuperProperties($longUri);
554 554
                 }
555 555
 
556 556
                 // we're reading only one super property, even if there are multiple ones
557
-                $superprop = ($superprops)?$superprops[0]:null;
557
+                $superprop = ($superprops) ? $superprops[0] : null;
558 558
                 if ($superprop) {
559 559
                     $superprop = EasyRdf\RdfNamespace::shorten($superprop) ? EasyRdf\RdfNamespace::shorten($superprop) : $superprop;
560 560
                 }
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
                 }
568 568
 
569 569
                 // searching for subproperties of literals too
570
-                if($superprops) {
570
+                if ($superprops) {
571 571
                     foreach ($superprops as $subi) {
572 572
                         $suburi = EasyRdf\RdfNamespace::shorten($subi) ? EasyRdf\RdfNamespace::shorten($subi) : $subi;
573 573
                         $duplicates[$suburi] = $prop;
@@ -729,14 +729,14 @@  discard block
 block discarded – undo
729 729
 
730 730
             // making a human readable string from the timestamps
731 731
             if ($created != '') {
732
-                $ret = gettext('skosmos:created') . ' ' . (Punic\Calendar::formatDate($created, 'short', $this->getEnvLang()));
732
+                $ret = gettext('skosmos:created').' '.(Punic\Calendar::formatDate($created, 'short', $this->getEnvLang()));
733 733
             }
734 734
 
735 735
             if ($modified != '') {
736 736
                 if ($created != '') {
737
-                    $ret .= ', ' . gettext('skosmos:modified') . ' ' . (Punic\Calendar::formatDate($modified, 'short', $this->getEnvLang()));
737
+                    $ret .= ', '.gettext('skosmos:modified').' '.(Punic\Calendar::formatDate($modified, 'short', $this->getEnvLang()));
738 738
                 } else {
739
-                    $ret .= ' ' . ucfirst(gettext('skosmos:modified')) . ' ' . (Punic\Calendar::formatDate($modified, 'short', $this->getEnvLang()));
739
+                    $ret .= ' '.ucfirst(gettext('skosmos:modified')).' '.(Punic\Calendar::formatDate($modified, 'short', $this->getEnvLang()));
740 740
                 }
741 741
 
742 742
             }
@@ -744,12 +744,12 @@  discard block
 block discarded – undo
744 744
             trigger_error($e->getMessage(), E_USER_WARNING);
745 745
             $ret = '';
746 746
             if ($this->resource->get('dc:modified')) {
747
-                $modified = (string) $this->resource->get('dc:modified');
748
-                $ret = gettext('skosmos:modified') . ' ' . $modified;
747
+                $modified = (string)$this->resource->get('dc:modified');
748
+                $ret = gettext('skosmos:modified').' '.$modified;
749 749
             }
750 750
             if ($this->resource->get('dc:created')) {
751
-                $created .= (string) $this->resource->get('dc:created');
752
-                $ret .= ' ' . gettext('skosmos:created') . ' ' . $created;
751
+                $created .= (string)$this->resource->get('dc:created');
752
+                $ret .= ' '.gettext('skosmos:created').' '.$created;
753 753
             }
754 754
         }
755 755
         return $ret;
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
                     $groups[$collLabel] = array($group);
822 822
 
823 823
                     $res = $collection;
824
-                    while($super = $this->graph->resourcesMatching('skos:member', $res)) {
824
+                    while ($super = $this->graph->resourcesMatching('skos:member', $res)) {
825 825
                         foreach ($super as $res) {
826 826
                             $superprop = new ConceptPropertyValue($this->model, $this->vocab, $res, 'skosmos:memberOfSuper', $this->clang);
827 827
                             array_unshift($groups[$collLabel], $superprop);
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
 
867 867
         foreach ($labels as $lit) {
868 868
             // filtering away subsets of the current language eg. en vs en-GB
869
-            if ($lit->getLang() != $this->clang && strpos($lit->getLang(), $this->getEnvLang() . '-') !== 0) {
869
+            if ($lit->getLang() != $this->clang && strpos($lit->getLang(), $this->getEnvLang().'-') !== 0) {
870 870
                 $langCode = $lit->getLang() ? $lit->getLang() : '';
871 871
                 $ret[$langCode][$key][] = new ConceptPropertyValueLiteral($this->model, $this->vocab, $this->resource, $lit, $prop);
872 872
             }
@@ -957,10 +957,10 @@  discard block
 block discarded – undo
957 957
             }
958 958
             else if ($context[$vocabPrefix] !== $vocabUriSpace) {
959 959
                 $i = 2;
960
-                while (isset($context[$vocabPrefix . $i]) && $context[$vocabPrefix . $i] !== $vocabUriSpace) {
960
+                while (isset($context[$vocabPrefix.$i]) && $context[$vocabPrefix.$i] !== $vocabUriSpace) {
961 961
                     $i += 1;
962 962
                 }
963
-                $context[$vocabPrefix . $i] = $vocabUriSpace;
963
+                $context[$vocabPrefix.$i] = $vocabUriSpace;
964 964
             }
965 965
         }
966 966
         $compactJsonLD = \ML\JsonLD\JsonLD::compact($this->graph->serialise('jsonld'), json_encode($context));
Please login to merge, or discard this patch.
model/sparql/GenericSparql.php 1 patch
Spacing   +51 added lines, -51 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>" : '';
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 
236 236
 	$quote_string = function($val) { return "'$val'"; };
237 237
 	$quoted_values = array_map($quote_string, $langs);
238
-	$langFilter = "FILTER(?lang IN (" . implode(',', $quoted_values) . "))";
238
+	$langFilter = "FILTER(?lang IN (".implode(',', $quoted_values)."))";
239 239
 
240 240
         $values = $this->formatValues('?type', $classes, 'uri');
241 241
         $valuesProp = $this->formatValues('?prop', $props, null);
@@ -667,9 +667,9 @@  discard block
 block discarded – undo
667 667
                 $conceptscheme['title'] = $row->title->getValue();
668 668
             }
669 669
             // add dct:subject and their labels in the result
670
-            if(isset($row->domain) && isset($row->domainLabel)){
671
-                $conceptscheme['subject']['uri']=$row->domain->getURI();
672
-                $conceptscheme['subject']['prefLabel']=$row->domainLabel->getValue();
670
+            if (isset($row->domain) && isset($row->domainLabel)) {
671
+                $conceptscheme['subject']['uri'] = $row->domain->getURI();
672
+                $conceptscheme['subject']['prefLabel'] = $row->domainLabel->getValue();
673 673
             }
674 674
 
675 675
             $ret[$row->cs->getURI()] = $conceptscheme;
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
           $values[] = "<$graph>";
737 737
         }
738 738
         if (count($values)) {
739
-          return "FILTER (?graph IN (" . implode(',', $values) . "))";
739
+          return "FILTER (?graph IN (".implode(',', $values)."))";
740 740
         }
741 741
     }
742 742
 
@@ -747,16 +747,16 @@  discard block
 block discarded – undo
747 747
      * @return string sparql query clauses
748 748
      */
749 749
     protected function formatLimitAndOffset($limit, $offset) {
750
-        $limit = ($limit) ? 'LIMIT ' . $limit : '';
751
-        $offset = ($offset) ? 'OFFSET ' . $offset : '';
750
+        $limit = ($limit) ? 'LIMIT '.$limit : '';
751
+        $offset = ($offset) ? 'OFFSET '.$offset : '';
752 752
         // eliminating whitespace and line changes when the conditions aren't needed.
753 753
         $limitandoffset = '';
754 754
         if ($limit && $offset) {
755
-            $limitandoffset = "\n" . $limit . "\n" . $offset;
755
+            $limitandoffset = "\n".$limit."\n".$offset;
756 756
         } elseif ($limit) {
757
-            $limitandoffset = "\n" . $limit;
757
+            $limitandoffset = "\n".$limit;
758 758
         } elseif ($offset) {
759
-            $limitandoffset = "\n" . $offset;
759
+            $limitandoffset = "\n".$offset;
760 760
         }
761 761
 
762 762
         return $limitandoffset;
@@ -908,14 +908,14 @@  discard block
 block discarded – undo
908 908
         // if search language and UI/display language differ, must also consider case where there is no prefLabel in
909 909
         // the display language; in that case, should use the label with the same language as the matched label
910 910
         $labelcondFallback = ($searchLang != $lang) ?
911
-          "OPTIONAL { # in case previous OPTIONAL block gives no labels\n" .
911
+          "OPTIONAL { # in case previous OPTIONAL block gives no labels\n".
912 912
           "?s skos:prefLabel ?label . FILTER (LANGMATCHES(LANG(?label), LANG(?match))) }" : "";
913 913
 
914 914
         //  Including the labels if there is no query term given.
915 915
         if ($rawterm === '') {
916 916
           $labelClause = "?s skos:prefLabel ?label .";
917
-          $labelClause = ($lang) ? $labelClause . " FILTER (LANGMATCHES(LANG(?label), '$lang'))" : $labelClause . "";
918
-          return $labelClause . " BIND(?label AS ?match)";
917
+          $labelClause = ($lang) ? $labelClause." FILTER (LANGMATCHES(LANG(?label), '$lang'))" : $labelClause."";
918
+          return $labelClause." BIND(?label AS ?match)";
919 919
         }
920 920
 
921 921
         /*
@@ -987,20 +987,20 @@  discard block
 block discarded – undo
987 987
         $schemecond = '';
988 988
         if (!empty($schemes)) {
989 989
             $conditions = array();
990
-            foreach($schemes as $scheme) {
990
+            foreach ($schemes as $scheme) {
991 991
                 $conditions[] = "{?s skos:inScheme <$scheme>}";
992 992
             }
993
-            $schemecond = '{'.implode(" UNION ",$conditions).'}';
993
+            $schemecond = '{'.implode(" UNION ", $conditions).'}';
994 994
         }
995
-        $filterDeprecated="";
995
+        $filterDeprecated = "";
996 996
         //show or hide deprecated concepts
997
-        if(!$showDeprecated){
998
-            $filterDeprecated="FILTER NOT EXISTS { ?s owl:deprecated true }";
997
+        if (!$showDeprecated) {
998
+            $filterDeprecated = "FILTER NOT EXISTS { ?s owl:deprecated true }";
999 999
         }
1000 1000
         // extra conditions for parent and group, if specified
1001
-        $parentcond = ($params->getParentLimit()) ? "?s skos:broader+ <" . $params->getParentLimit() . "> ." : "";
1002
-        $groupcond = ($params->getGroupLimit()) ? "<" . $params->getGroupLimit() . "> skos:member ?s ." : "";
1003
-        $pgcond = $parentcond . $groupcond;
1001
+        $parentcond = ($params->getParentLimit()) ? "?s skos:broader+ <".$params->getParentLimit()."> ." : "";
1002
+        $groupcond = ($params->getGroupLimit()) ? "<".$params->getGroupLimit()."> skos:member ?s ." : "";
1003
+        $pgcond = $parentcond.$groupcond;
1004 1004
 
1005 1005
         $orderextra = $this->isDefaultEndpoint() ? $this->graph : '';
1006 1006
 
@@ -1086,9 +1086,9 @@  discard block
 block discarded – undo
1086 1086
             $hit['type'][] = $this->shortenUri($typeuri);
1087 1087
         }
1088 1088
 
1089
-        if(!empty($fields)) {
1089
+        if (!empty($fields)) {
1090 1090
             foreach ($fields as $prop) {
1091
-                $propname = $prop . 's';
1091
+                $propname = $prop.'s';
1092 1092
                 if (isset($row->$propname)) {
1093 1093
                     foreach (explode("\n", $row->$propname->getValue()) as $line) {
1094 1094
                         $rdata = str_getcsv($line, ',', '"', '"');
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
                             $propvals = $rdata[2];
1104 1104
                         }
1105 1105
 
1106
-                        $hit['skos:' . $prop][] = $propvals;
1106
+                        $hit['skos:'.$prop][] = $propvals;
1107 1107
                     }
1108 1108
                 }
1109 1109
             }
@@ -1179,7 +1179,7 @@  discard block
 block discarded – undo
1179 1179
      * @return array query result object
1180 1180
      */
1181 1181
     public function queryConcepts($vocabs, $fields = null, $unique = false, $params, $showDeprecated = false) {
1182
-        $query = $this->generateConceptSearchQuery($fields, $unique, $params,$showDeprecated);
1182
+        $query = $this->generateConceptSearchQuery($fields, $unique, $params, $showDeprecated);
1183 1183
         $results = $this->query($query);
1184 1184
         return $this->transformConceptSearchResults($results, $vocabs, $fields);
1185 1185
     }
@@ -1234,10 +1234,10 @@  discard block
 block discarded – undo
1234 1234
         $conditions = $this->formatFilterConditions($letter, $lang);
1235 1235
         $filtercondLabel = $conditions['filterpref'];
1236 1236
         $filtercondALabel = $conditions['filteralt'];
1237
-        $qualifierClause = $qualifier ? "OPTIONAL { ?s <" . $qualifier->getURI() . "> ?qualifier }" : "";
1238
-        $filterDeprecated="";
1239
-        if(!$showDeprecated){
1240
-            $filterDeprecated="FILTER NOT EXISTS { ?s owl:deprecated true }";
1237
+        $qualifierClause = $qualifier ? "OPTIONAL { ?s <".$qualifier->getURI()."> ?qualifier }" : "";
1238
+        $filterDeprecated = "";
1239
+        if (!$showDeprecated) {
1240
+            $filterDeprecated = "FILTER NOT EXISTS { ?s owl:deprecated true }";
1241 1241
         }
1242 1242
         $query = <<<EOQ
1243 1243
 SELECT DISTINCT ?s ?label ?alabel ?qualifier
@@ -1711,7 +1711,7 @@  discard block
 block discarded – undo
1711 1711
                 if (!isset($row->label) || $row->label->getLang() === $lang) {
1712 1712
                     $ret[$row->object->getUri()] = $val;
1713 1713
                 } elseif ($row->label->getLang() === $fallbacklang) {
1714
-                    $val['label'] .= ' (' . $row->label->getLang() . ')';
1714
+                    $val['label'] .= ' ('.$row->label->getLang().')';
1715 1715
                     $ret[$row->object->getUri()] = $val;
1716 1716
                 }
1717 1717
             }
@@ -1807,10 +1807,10 @@  discard block
 block discarded – undo
1807 1807
 
1808 1808
             $label = null;
1809 1809
             if (isset($row->label)) {
1810
-                if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang . "-") == 0) {
1810
+                if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang."-") == 0) {
1811 1811
                     $label = $row->label->getValue();
1812 1812
                 } else {
1813
-                    $label = $row->label->getValue() . " (" . $row->label->getLang() . ")";
1813
+                    $label = $row->label->getValue()." (".$row->label->getLang().")";
1814 1814
                 }
1815 1815
 
1816 1816
             }
@@ -1886,8 +1886,8 @@  discard block
 block discarded – undo
1886 1886
         foreach ($result as $row) {
1887 1887
             if (isset($row->top) && isset($row->label)) {
1888 1888
                 $label = $row->label->getValue();
1889
-                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang . "-") !== 0) {
1890
-                    $label .= ' (' . $row->label->getLang() . ')';
1889
+                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang."-") !== 0) {
1890
+                    $label .= ' ('.$row->label->getLang().')';
1891 1891
                 }
1892 1892
                 $top = array('uri' => $row->top->getUri(), 'topConceptOf' => $row->topuri->getUri(), 'label' => $label, 'hasChildren' => filter_var($row->children->getValue(), FILTER_VALIDATE_BOOLEAN));
1893 1893
                 if (isset($row->notation)) {
@@ -1980,7 +1980,7 @@  discard block
 block discarded – undo
1980 1980
                 $ret[$uri]['exact'] = $row->exact->getUri();
1981 1981
             }
1982 1982
             if (isset($row->tops)) {
1983
-               $topConceptsList=explode(" ", $row->tops->getValue());
1983
+               $topConceptsList = explode(" ", $row->tops->getValue());
1984 1984
                // sort to garantee an alphabetical ordering of the URI
1985 1985
                sort($topConceptsList);
1986 1986
                $ret[$uri]['tops'] = $topConceptsList;
@@ -1993,8 +1993,8 @@  discard block
 block discarded – undo
1993 1993
                 $label = null;
1994 1994
                 if (isset($row->childlabel)) {
1995 1995
                     $label = $row->childlabel->getValue();
1996
-                    if ($row->childlabel->getLang() !== $lang && strpos($row->childlabel->getLang(), $lang . "-") !== 0) {
1997
-                        $label .= " (" . $row->childlabel->getLang() . ")";
1996
+                    if ($row->childlabel->getLang() !== $lang && strpos($row->childlabel->getLang(), $lang."-") !== 0) {
1997
+                        $label .= " (".$row->childlabel->getLang().")";
1998 1998
                     }
1999 1999
 
2000 2000
                 }
@@ -2015,8 +2015,8 @@  discard block
 block discarded – undo
2015 2015
             }
2016 2016
             if (isset($row->label)) {
2017 2017
                 $preflabel = $row->label->getValue();
2018
-                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang . "-") !== 0) {
2019
-                    $preflabel .= ' (' . $row->label->getLang() . ')';
2018
+                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang."-") !== 0) {
2019
+                    $preflabel .= ' ('.$row->label->getLang().')';
2020 2020
                 }
2021 2021
 
2022 2022
                 $ret[$uri]['prefLabel'] = $preflabel;
@@ -2137,9 +2137,9 @@  discard block
 block discarded – undo
2137 2137
      */
2138 2138
     private function generateConceptGroupContentsQuery($groupClass, $group, $lang, $showDeprecated = false) {
2139 2139
         $fcl = $this->generateFromClause();
2140
-        $filterDeprecated="";
2141
-        if(!$showDeprecated){
2142
-            $filterDeprecated="  FILTER NOT EXISTS { ?conc owl:deprecated true }";
2140
+        $filterDeprecated = "";
2141
+        if (!$showDeprecated) {
2142
+            $filterDeprecated = "  FILTER NOT EXISTS { ?conc owl:deprecated true }";
2143 2143
         }
2144 2144
         $query = <<<EOQ
2145 2145
 SELECT ?conc ?super ?label ?members ?type ?notation $fcl
@@ -2178,10 +2178,10 @@  discard block
 block discarded – undo
2178 2178
                     'type' => array($row->type->shorten()),
2179 2179
                 );
2180 2180
                 if (isset($row->label)) {
2181
-                    if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang . "-") == 0) {
2181
+                    if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang."-") == 0) {
2182 2182
                         $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue();
2183 2183
                     } else {
2184
-                        $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue() . " (" . $row->label->getLang() . ")";
2184
+                        $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue()." (".$row->label->getLang().")";
2185 2185
                     }
2186 2186
 
2187 2187
                 }
@@ -2209,8 +2209,8 @@  discard block
 block discarded – undo
2209 2209
      * @param boolean $showDeprecated whether to include deprecated concepts in search results
2210 2210
      * @return array Result array with concept URI as key and concept label as value
2211 2211
      */
2212
-    public function listConceptGroupContents($groupClass, $group, $lang,$showDeprecated = false) {
2213
-        $query = $this->generateConceptGroupContentsQuery($groupClass, $group, $lang,$showDeprecated);
2212
+    public function listConceptGroupContents($groupClass, $group, $lang, $showDeprecated = false) {
2213
+        $query = $this->generateConceptGroupContentsQuery($groupClass, $group, $lang, $showDeprecated);
2214 2214
         $result = $this->query($query);
2215 2215
         return $this->transformConceptGroupContentsResults($result, $lang);
2216 2216
     }
@@ -2223,9 +2223,9 @@  discard block
 block discarded – undo
2223 2223
      * @param int $limit maximum number of results to return
2224 2224
      * @return string sparql query
2225 2225
      */
2226
-    private function generateChangeListQuery($prop, $lang, $offset, $limit=200) {
2226
+    private function generateChangeListQuery($prop, $lang, $offset, $limit = 200) {
2227 2227
         $fcl = $this->generateFromClause();
2228
-        $offset = ($offset) ? 'OFFSET ' . $offset : '';
2228
+        $offset = ($offset) ? 'OFFSET '.$offset : '';
2229 2229
 
2230 2230
         $query = <<<EOQ
2231 2231
 SELECT DISTINCT ?concept ?date ?label $fcl
Please login to merge, or discard this patch.
controller/RestController.php 1 patch
Spacing   +22 added lines, -22 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
             }
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         if ($request->getQueryParam('labellang')) {
161 161
             $ret['@context']['@language'] = $request->getQueryParam('labellang');
162 162
         } elseif ($request->getQueryParam('lang')) {
163
-            $ret['@context']['@language'] = $request->getQueryParam('lang');;
163
+            $ret['@context']['@language'] = $request->getQueryParam('lang'); ;
164 164
         }
165 165
         return $ret;
166 166
     }
@@ -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(),
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
                 'subTypes' => array('@id' => 'void:class', '@type' => '@id'),
284 284
                 'count' => 'void:entities',
285 285
                 '@language' => $request->getLang(),
286
-                '@base' => $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/",
286
+                '@base' => $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/",
287 287
             ),
288 288
             'uri' => '',
289 289
             'id' => $request->getVocab()->getId(),
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
                 'language' => 'void-ext:language',
361 361
                 'properties' => 'void:propertyPartition',
362 362
                 'labels' => 'void:triples',
363
-                '@base' => $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/",
363
+                '@base' => $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/",
364 364
             ),
365 365
             'uri' => '',
366 366
             'id' => $request->getVocab()->getId(),
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
             $types[] = $type;
402 402
         }
403 403
 
404
-        $base = $request->getVocab() ? $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/" : $this->getBaseHref() . "rest/v1/";
404
+        $base = $request->getVocab() ? $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/" : $this->getBaseHref()."rest/v1/";
405 405
 
406 406
         $ret = array_merge_recursive($this->context, array(
407 407
             '@context' => array(
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
         if ($lang === null) {
443 443
             // case 1A: exact match on preferred label in any language
444 444
             foreach ($results as $res) {
445
-                if (isset($res['matchedPrefLabel']) && $res['matchedPrefLabel']  == $label) {
445
+                if (isset($res['matchedPrefLabel']) && $res['matchedPrefLabel'] == $label) {
446 446
                     $res['prefLabel'] = $res['matchedPrefLabel'];
447 447
                     unset($res['matchedPrefLabel']);
448 448
                     $hits[] = $res;
@@ -564,19 +564,19 @@  discard block
 block discarded – undo
564 564
 
565 565
         $format = $this->negotiateFormat(array_keys($urls), $request->getServerConstant('HTTP_ACCEPT'), $request->getQueryParam('format'));
566 566
         if (!$format) {
567
-            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: " . implode(' ', array_keys($urls)));
567
+            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: ".implode(' ', array_keys($urls)));
568 568
         }
569 569
         if (is_array($urls[$format])) {
570 570
             $arr = $urls[$format];
571 571
             $dataLang = $request->getLang();
572 572
             if (isset($arr[$dataLang])) {
573
-                header("Location: " . $arr[$dataLang]);
573
+                header("Location: ".$arr[$dataLang]);
574 574
             } else {
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 578
 		} else {
579
-            header("Location: " . $urls[$format]);
579
+            header("Location: ".$urls[$format]);
580 580
 		}
581 581
     }
582 582
 
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 
640 640
         $format = $this->negotiateFormat(explode(' ', self::SUPPORTED_FORMATS), $request->getServerConstant('HTTP_ACCEPT'), $request->getQueryParam('format'));
641 641
         if (!$format) {
642
-            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: " . self::SUPPORTED_FORMATS);
642
+            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: ".self::SUPPORTED_FORMATS);
643 643
         }
644 644
 
645 645
         $vocid = $vocab ? $vocab->getId() : null;
@@ -924,7 +924,7 @@  discard block
 block discarded – undo
924 924
                         }
925 925
                     }
926 926
                     // if the main concept scheme was not found, set 'top' to the first 'tops' (sorted alphabetically on the URIs)
927
-                    if (! isset($results[$uri]['top'])) {
927
+                    if (!isset($results[$uri]['top'])) {
928 928
                         $results[$uri]['top'] = $results[$uri]['tops'][0];
929 929
                     }
930 930
                 } else {
@@ -1102,18 +1102,18 @@  discard block
 block discarded – undo
1102 1102
         $changeList = $request->getVocab()->getChangeList($prop, $request->getLang(), $offset, $limit);
1103 1103
 
1104 1104
         $simpleChangeList = array();
1105
-        foreach($changeList as $conceptInfo) {
1105
+        foreach ($changeList as $conceptInfo) {
1106 1106
             if (array_key_exists('date', $conceptInfo)) {
1107
-                $simpleChangeList[] =  array( 'uri' => $conceptInfo['uri'],
1107
+                $simpleChangeList[] = array('uri' => $conceptInfo['uri'],
1108 1108
                                                'prefLabel' => $conceptInfo['prefLabel'],
1109
-                                               'date' => $conceptInfo['date']->format("Y-m-d\TH:i:sO") );
1109
+                                               'date' => $conceptInfo['date']->format("Y-m-d\TH:i:sO"));
1110 1110
             }
1111 1111
         }
1112 1112
         return $this->returnJson(array_merge_recursive($this->context,
1113
-                                                        array('@context' => array( '@language' => $request->getLang(),
1113
+                                                        array('@context' => array('@language' => $request->getLang(),
1114 1114
                                                                                      'prefLabel' => 'skos:prefLabel',
1115 1115
                                                                                      'xsd' => 'http://www.w3.org/2001/XMLSchema#',
1116
-                                                                                     'date' => array( '@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime') )
1116
+                                                                                     'date' => array('@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime'))
1117 1117
                                                         ),
1118 1118
                                                         array('changeList' => $simpleChangeList)));
1119 1119
 
Please login to merge, or discard this patch.
controller/Honeypot.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
     {
33 33
         // Encrypt the current time
34 34
         $honey_time_encrypted = $this->getEncryptedTime();
35
-        return '<div id="' . $honey_name . '_wrap" style="display:none;">' . "\r\n" .
36
-               '<input name="' . $honey_name . '" type="text" value="" id="' . $honey_name . '"/>' . "\r\n" .
37
-               '<input name="' . $honey_time . '" type="text" value="' . $honey_time_encrypted . '"/>' . "\r\n" .
35
+        return '<div id="'.$honey_name.'_wrap" style="display:none;">'."\r\n".
36
+               '<input name="'.$honey_name.'" type="text" value="" id="'.$honey_name.'"/>'."\r\n".
37
+               '<input name="'.$honey_time.'" type="text" value="'.$honey_time_encrypted.'"/>'."\r\n".
38 38
                 '</div>';
39 39
     }
40 40
     /**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         // Get the decrypted time
67 67
         $value = $this->decryptTime($value);
68 68
         // The current time should be greater than the time the form was built + minimum
69
-        return ( is_numeric($value) && time() > ($value + $minDelta) );
69
+        return (is_numeric($value) && time() > ($value + $minDelta));
70 70
     }
71 71
     /**
72 72
      * Get encrypted time
Please login to merge, or discard this patch.
controller/WebController.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         // specify where to look for templates and cache
38 38
         $loader = new Twig_Loader_Filesystem('view');
39 39
         // initialize Twig environment
40
-        $this->twig = new Twig_Environment($loader, array('cache' => $tmpDir,'auto_reload' => true));
40
+        $this->twig = new Twig_Environment($loader, array('cache' => $tmpDir, 'auto_reload' => true));
41 41
         $this->twig->addExtension(new Twig_Extensions_Extension_I18n());
42 42
         // used for setting the base href for the relative urls
43 43
         $this->twig->addGlobal("BaseHref", $this->getBaseHref());
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         $this->twig->addFilter(new Twig_SimpleFilter('link_url', array($this, 'linkUrlFilter')));
61 61
 
62 62
         // register a Twig filter for generating strings from language codes with CLDR
63
-        $langFilter = new Twig_SimpleFilter('lang_name', function ($langcode, $lang) {
63
+        $langFilter = new Twig_SimpleFilter('lang_name', function($langcode, $lang) {
64 64
             return Language::getName($langcode, $lang);
65 65
         });
66 66
         $this->twig->addFilter($langFilter);
@@ -235,16 +235,16 @@  discard block
 block discarded – undo
235 235
 
236 236
     private function createFeedbackHeaders($fromName, $fromEmail, $toMail, $sender)
237 237
     {
238
-        $headers = "MIME-Version: 1.0" . "\r\n";
239
-        $headers .= "Content-type: text/html; charset=UTF-8" . "\r\n";
238
+        $headers = "MIME-Version: 1.0"."\r\n";
239
+        $headers .= "Content-type: text/html; charset=UTF-8"."\r\n";
240 240
         if (!empty($toMail)) {
241
-            $headers .= "Cc: " . $this->model->getConfig()->getFeedbackAddress() . "\r\n";
241
+            $headers .= "Cc: ".$this->model->getConfig()->getFeedbackAddress()."\r\n";
242 242
         }
243 243
         if (!empty($fromEmail)) {
244 244
             $headers .= "Reply-To: $fromName <$fromEmail>\r\n";
245 245
         }
246 246
         $service = $this->model->getConfig()->getServiceName();
247
-        return $headers . "From: $fromName via $service <$sender>";
247
+        return $headers."From: $fromName via $service <$sender>";
248 248
     }
249 249
 
250 250
     /**
@@ -258,9 +258,9 @@  discard block
 block discarded – undo
258 258
     public function sendFeedback($request, $message, $messageSubject, $fromName = null, $fromEmail = null, $fromVocab = null, $toMail = null)
259 259
     {
260 260
         $toAddress = ($toMail) ? $toMail : $this->model->getConfig()->getFeedbackAddress();
261
-        $messageSubject = "[" . $this->model->getConfig()->getServiceName() . "] " . $messageSubject;
261
+        $messageSubject = "[".$this->model->getConfig()->getServiceName()."] ".$messageSubject;
262 262
         if ($fromVocab !== null && $fromVocab !== '') {
263
-            $message = 'Feedback from vocab: ' . strtoupper($fromVocab) . "<br />" . $message;
263
+            $message = 'Feedback from vocab: '.strtoupper($fromVocab)."<br />".$message;
264 264
         }
265 265
         $envelopeSender = $this->model->getConfig()->getFeedbackEnvelopeSender();
266 266
         // determine the sender address of the message
@@ -273,10 +273,10 @@  discard block
 block discarded – undo
273 273
         $headers = $this->createFeedbackHeaders($fromName, $fromEmail, $toMail, $sender);
274 274
         $params = empty($envelopeSender) ? '' : "-f $envelopeSender";
275 275
         // adding some information about the user for debugging purposes.
276
-        $message = $message . "<br /><br /> Debugging information:"
277
-            . "<br />Timestamp: " . date(DATE_RFC2822)
278
-            . "<br />User agent: " . $request->getServerConstant('HTTP_USER_AGENT')
279
-            . "<br />Referer: " . $request->getServerConstant('HTTP_REFERER');
276
+        $message = $message."<br /><br /> Debugging information:"
277
+            . "<br />Timestamp: ".date(DATE_RFC2822)
278
+            . "<br />User agent: ".$request->getServerConstant('HTTP_USER_AGENT')
279
+            . "<br />Referer: ".$request->getServerConstant('HTTP_REFERER');
280 280
 
281 281
         try {
282 282
             mail($toAddress, $messageSubject, $message, $headers, $params);
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
             header("HTTP/1.0 404 Not Found");
285 285
             $template = $this->twig->loadTemplate('error-page.twig');
286 286
             if ($this->model->getConfig()->getLogCaughtExceptions()) {
287
-                error_log('Caught exception: ' . $e->getMessage());
287
+                error_log('Caught exception: '.$e->getMessage());
288 288
             }
289 289
 
290 290
             echo $template->render(
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
         $vocids = ($vocabs !== null && $vocabs !== '') ? explode(' ', $vocabs) : null;
332 332
         $vocabObjects = array();
333 333
         if ($vocids) {
334
-            foreach($vocids as $vocid) {
334
+            foreach ($vocids as $vocid) {
335 335
                 $vocabObjects[] = $this->model->getVocabulary($vocid);
336 336
             }
337 337
         }
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
         } catch (Exception $e) {
343 343
             header("HTTP/1.0 404 Not Found");
344 344
             if ($this->model->getConfig()->getLogCaughtExceptions()) {
345
-                error_log('Caught exception: ' . $e->getMessage());
345
+                error_log('Caught exception: '.$e->getMessage());
346 346
             }
347 347
             $this->invokeGenericErrorPage($request, $e->getMessage());
348 348
             return;
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
                 'search_count' => $counts,
359 359
                 'languages' => $this->languages,
360 360
                 'search_results' => $searchResults,
361
-                'rest' => $parameters->getOffset()>0,
361
+                'rest' => $parameters->getOffset() > 0,
362 362
                 'global_search' => true,
363 363
                 'term' => $request->getQueryParamRaw('q'),
364 364
                 'lang_list' => $langList,
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
         } catch (Exception $e) {
384 384
             header("HTTP/1.0 404 Not Found");
385 385
             if ($this->model->getConfig()->getLogCaughtExceptions()) {
386
-                error_log('Caught exception: ' . $e->getMessage());
386
+                error_log('Caught exception: '.$e->getMessage());
387 387
             }
388 388
 
389 389
             echo $template->render(
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
         } catch (Exception $e) {
405 405
             header("HTTP/1.0 404 Not Found");
406 406
             if ($this->model->getConfig()->getLogCaughtExceptions()) {
407
-                error_log('Caught exception: ' . $e->getMessage());
407
+                error_log('Caught exception: '.$e->getMessage());
408 408
             }
409 409
 
410 410
             echo $template->render(
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
                 'vocab' => $vocab,
422 422
                 'search_results' => $searchResults,
423 423
                 'search_count' => $counts,
424
-                'rest' => $parameters->getOffset()>0,
424
+                'rest' => $parameters->getOffset() > 0,
425 425
                 'limit_parent' => $parameters->getParentLimit(),
426 426
                 'limit_type' =>  $request->getQueryParam('type') ? explode('+', $request->getQueryParam('type')) : null,
427 427
                 'limit_group' => $parameters->getGroupLimit(),
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
      * Loads and renders the view containing a list of recent changes in the vocabulary.
553 553
      * @param Request $request
554 554
      */
555
-    public function invokeChangeList($request, $prop='dc:created')
555
+    public function invokeChangeList($request, $prop = 'dc:created')
556 556
     {
557 557
         $offset = ($request->getQueryParam('offset') && is_numeric($request->getQueryParam('offset')) && $request->getQueryParam('offset') >= 0) ? $request->getQueryParam('offset') : 0;
558 558
         $limit = ($request->getQueryParam('limit') && is_numeric($request->getQueryParam('limit')) && $request->getQueryParam('limit') >= 0) ? $request->getQueryParam('limit') : 200;
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
      * @param int $limit maximum number of concepts to return
581 581
      * @return Array list of concepts
582 582
      */
583
-    public function getChangeList($request, $prop, $offset=0, $limit=200)
583
+    public function getChangeList($request, $prop, $offset = 0, $limit = 200)
584 584
     {
585 585
         // set language parameters for gettext
586 586
         $this->setLanguageProperties($request->getLang());
@@ -596,9 +596,9 @@  discard block
 block discarded – undo
596 596
     public function formatChangeList($changeList, $lang)
597 597
     {
598 598
         $formatByDate = array();
599
-        foreach($changeList as $concept) {
599
+        foreach ($changeList as $concept) {
600 600
             $concept['datestring'] = Punic\Calendar::formatDate($concept['date'], 'medium', $lang);
601
-            $formatByDate[Punic\Calendar::getMonthName($concept['date'], 'wide', $lang, true) . Punic\Calendar::format($concept['date'], ' y', $lang) ][strtolower($concept['prefLabel'])] = $concept;
601
+            $formatByDate[Punic\Calendar::getMonthName($concept['date'], 'wide', $lang, true).Punic\Calendar::format($concept['date'], ' y', $lang)][strtolower($concept['prefLabel'])] = $concept;
602 602
         }
603 603
         return $formatByDate;
604 604
     }
Please login to merge, or discard this patch.