Completed
Push — master ( b4ce95...c1a339 )
by Osma
02:13 queued 10s
created
controller/Controller.php 2 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,6 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
     /**
25 25
      * Initializes the Model object.
26
+     * @param Model $model
26 27
      */
27 28
     public function __construct($model)
28 29
     {
@@ -290,7 +291,7 @@  discard block
 block discarded – undo
290 291
      * Sends HTTP headers. Simply calls PHP built-in header function. But being
291 292
      * a function here, it can easily be tested/mocked.
292 293
      *
293
-     * @param $header string header to be sent
294
+     * @param string $header string header to be sent
294 295
      */
295 296
     protected function sendHeader($header)
296 297
     {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -156,18 +156,18 @@  discard block
 block discarded – undo
156 156
         $localname = $vocab->getLocalName($uri);
157 157
         if ($localname !== $uri && $localname === urlencode($localname)) {
158 158
             // check that the prefix stripping worked, and there are no problematic chars in localname
159
-            $paramstr = count($params) > 0 ? '?' . http_build_query($params) : '';
159
+            $paramstr = count($params) > 0 ? '?'.http_build_query($params) : '';
160 160
             if ($type && $type !== '' && $type !== 'vocab' && !($localname === '' && $type === 'page')) {
161
-                return "$vocid/$lang/$type/$localname" . $paramstr;
161
+                return "$vocid/$lang/$type/$localname".$paramstr;
162 162
             }
163 163
 
164
-            return "$vocid/$lang/$localname" . $paramstr;
164
+            return "$vocid/$lang/$localname".$paramstr;
165 165
         }
166 166
 
167 167
         // case 2: URI outside vocabulary namespace, or has problematic chars
168 168
         // pass the full URI as parameter instead
169 169
         $params['uri'] = $uri;
170
-        return "$vocid/$lang/$type/?" . http_build_query($params);
170
+        return "$vocid/$lang/$type/?".http_build_query($params);
171 171
     }
172 172
 
173 173
     /**
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
     {
294 294
         if ($modifiedDate) {
295 295
             $ifModifiedSince = $this->getIfModifiedSince();
296
-            $this->sendHeader("Last-Modified: " . $modifiedDate->format('D, d M Y H:i:s \G\M\T'));
296
+            $this->sendHeader("Last-Modified: ".$modifiedDate->format('D, d M Y H:i:s \G\M\T'));
297 297
             if ($ifModifiedSince !== null && $ifModifiedSince >= $modifiedDate) {
298 298
                 $this->sendHeader("HTTP/1.0 304 Not Modified");
299 299
                 return true;
Please login to merge, or discard this patch.
model/ConceptPropertyValue.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     {
25 25
         $label = is_string($this->getLabel()) ? $this->getLabel() : $this->getLabel()->getValue();
26 26
         if ($this->vocab->getConfig()->sortByNotation()) {
27
-            $label = ltrim($this->getNotation() . ' ') . $label;
27
+            $label = ltrim($this->getNotation().' ').$label;
28 28
         }
29 29
 
30 30
         return $label;
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
                 }
48 48
                 // We need to check all the labels in case one of them matches a subtag of the current language
49 49
                 if ($this->resource->allLiterals('skos:prefLabel')) {
50
-                    foreach($this->resource->allLiterals('skos:prefLabel') as $label) {
50
+                    foreach ($this->resource->allLiterals('skos:prefLabel') as $label) {
51 51
                         // the label lang code is a subtag of the UI lang eg. en-GB - create a new literal with the main language
52
-                        if ($label !== null && strpos($label->getLang(), $fallback . '-') === 0) {
52
+                        if ($label !== null && strpos($label->getLang(), $fallback.'-') === 0) {
53 53
                             return EasyRdf\Literal::create($label, $fallback);
54 54
                         }
55 55
                     }
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
     public function getReifiedPropertyValues() {
142 142
         $ret = array();
143 143
         $props = $this->resource->propertyUris();
144
-        foreach($props as $prop) {
144
+        foreach ($props as $prop) {
145 145
             $prop = (EasyRdf\RdfNamespace::shorten($prop) !== null) ? EasyRdf\RdfNamespace::shorten($prop) : $prop;
146 146
             foreach ($this->resource->allLiterals($prop) as $val) {
147 147
                 if ($prop !== 'rdf:value') { // shown elsewhere
Please login to merge, or discard this patch.
model/resolver/LOCResource.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
             $opts = array('http' => array('method'=>'HEAD',
14 14
                                           'user_agent' => 'Skosmos',
15 15
                                           'timeout' => $timeout));
16
-            $context  = stream_context_create($opts);
16
+            $context = stream_context_create($opts);
17 17
             $fd = fopen($this->uri, 'rb', false, $context);
18 18
             $headers = stream_get_meta_data($fd)['wrapper_data'];
19 19
             foreach ($headers as $header) {
Please login to merge, or discard this patch.
model/sparql/GenericSparql.php 4 patches
Doc Comments   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
     /**
154 154
      * Returns the graph instance
155
-     * @return object EasyRDF graph instance.
155
+     * @return string|null EasyRDF graph instance.
156 156
      */
157 157
     public function getGraph() {
158 158
         return $this->graph;
@@ -287,6 +287,7 @@  discard block
 block discarded – undo
287 287
     /**
288 288
      * Counts the number of concepts in a easyRDF graph with a specific language.
289 289
      * @param array $langs Languages to query for
290
+     * @param string[] $classes
290 291
      * @return Array containing count of concepts for each language and property.
291 292
      */
292 293
     public function countLangConcepts($langs, $classes = null) {
@@ -471,7 +472,7 @@  discard block
 block discarded – undo
471 472
      * Returns information (as a graph) for one or more concept URIs
472 473
      * @param mixed $uris concept URI (string) or array of URIs
473 474
      * @param string|null $arrayClass the URI for thesaurus array class, or null if not used
474
-     * @param \Vocabulary[]|null $vocabs vocabularies to target
475
+     * @param Vocabulary[] $vocabs vocabularies to target
475 476
      * @return \EasyRdf\Graph
476 477
      */
477 478
     public function queryConceptInfoGraph($uris, $arrayClass = null, $vocabs = array()) {
@@ -487,7 +488,7 @@  discard block
 block discarded – undo
487 488
 
488 489
     /**
489 490
      * Returns information (as an array of Concept objects) for one or more concept URIs
490
-     * @param mixed $uris concept URI (string) or array of URIs
491
+     * @param string $uris concept URI (string) or array of URIs
491 492
      * @param string|null $arrayClass the URI for thesaurus array class, or null if not used
492 493
      * @param \Vocabulary[] $vocabs vocabularies to target
493 494
      * @param string|null $clang content language
@@ -705,7 +706,7 @@  discard block
 block discarded – undo
705 706
 
706 707
     /**
707 708
      * Generate a VALUES clause for limiting the targeted graphs.
708
-     * @param Vocabulary[]|null $vocabs array of Vocabulary objects to target
709
+     * @param Vocabulary[] $vocabs array of Vocabulary objects to target
709 710
      * @return string VALUES clause, or "" if not necessary to limit
710 711
      */
711 712
     protected function formatValuesGraph($vocabs) {
@@ -887,6 +888,7 @@  discard block
 block discarded – undo
887 888
      * @param string $searchLang language code used for matching labels (null means any language)
888 889
      * @param string[] $props properties to target e.g. array('skos:prefLabel','skos:altLabel')
889 890
      * @param boolean $unique restrict results to unique concepts (default: false)
891
+     * @param string $filterGraph
890 892
      * @return string sparql query
891 893
      */
892 894
     protected function generateConceptSearchQueryInner($term, $lang, $searchLang, $props, $unique, $filterGraph)
@@ -1161,6 +1163,7 @@  discard block
 block discarded – undo
1161 1163
     /**
1162 1164
      * Generates sparql query clauses used for creating the alphabetical index.
1163 1165
      * @param string $letter the letter (or special class) to search for
1166
+     * @param string $lang
1164 1167
      * @return array of sparql query clause strings
1165 1168
      */
1166 1169
     private function formatFilterConditions($letter, $lang) {
@@ -1328,6 +1331,7 @@  discard block
 block discarded – undo
1328 1331
     /**
1329 1332
      * Query for the first characters (letter or otherwise) of the labels in the particular language.
1330 1333
      * @param string $lang language
1334
+     * @param string[] $classes
1331 1335
      * @return array array of characters
1332 1336
      */
1333 1337
     public function queryFirstCharacters($lang, $classes = null) {
@@ -1650,7 +1654,7 @@  discard block
 block discarded – undo
1650 1654
     /**
1651 1655
      * Query a single transitive property of a concept.
1652 1656
      * @param string $uri
1653
-     * @param array $props the property/properties.
1657
+     * @param string[] $props the property/properties.
1654 1658
      * @param string $lang
1655 1659
      * @param string $fallbacklang language to use if label is not available in the preferred language
1656 1660
      * @param integer $limit
Please login to merge, or discard this patch.
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -47,12 +47,16 @@  discard block
 block discarded – undo
47 47
         $this->client = new EasyRdf\Sparql\Client($endpoint);
48 48
 
49 49
         // set graphClause so that it can be used by all queries
50
-        if ($this->isDefaultEndpoint()) // default endpoint; query any graph (and catch it in a variable)
50
+        if ($this->isDefaultEndpoint()) {
51
+          // default endpoint; query any graph (and catch it in a variable)
51 52
         {
52 53
             $this->graphClause = "GRAPH $graph";
53
-        } elseif ($graph !== null) // query a specific graph
54
+        }
55
+        } elseif ($graph !== null) {
56
+          // query a specific graph
54 57
         {
55 58
             $this->graphClause = "GRAPH <$graph>";
59
+        }
56 60
         } else // query the default graph
57 61
         {
58 62
             $this->graphClause = "";
@@ -1274,8 +1278,7 @@  discard block
 block discarded – undo
1274 1278
             if (isset($row->qualifier)) {
1275 1279
                 if ($row->qualifier instanceof EasyRdf\Literal) {
1276 1280
                     $hit['qualifier'] = $row->qualifier->getValue();
1277
-                }
1278
-                else {
1281
+                } else {
1279 1282
                     $hit['qualifier'] = $row->qualifier->localName();
1280 1283
                 }
1281 1284
             }
@@ -1955,8 +1958,7 @@  discard block
 block discarded – undo
1955 1958
         if (sizeof($ret) > 0) {
1956 1959
             // existing concept, with children
1957 1960
             return $ret;
1958
-        }
1959
-        else {
1961
+        } else {
1960 1962
             // nonexistent concept
1961 1963
             return null;
1962 1964
         }
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      *
66 66
      * @param string $query
67 67
      * @return string
68
-    */
68
+     */
69 69
     protected function generateQueryPrefixes($query)
70 70
     {
71 71
         // Check for undefined prefixes
@@ -233,9 +233,9 @@  discard block
 block discarded – undo
233 233
         $gcl = $this->graphClause;
234 234
         $classes = ($classes) ? $classes : array('http://www.w3.org/2004/02/skos/core#Concept');
235 235
 
236
-	$quote_string = function($val) { return "'$val'"; };
237
-	$quoted_values = array_map($quote_string, $langs);
238
-	$langFilter = "FILTER(?lang IN (" . implode(',', $quoted_values) . "))";
236
+  $quote_string = function($val) { return "'$val'"; };
237
+  $quoted_values = array_map($quote_string, $langs);
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);
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
         return $query;
952 952
     }
953 953
     /**
954
-    *  This function can be overwritten in other SPARQL dialects for the possibility of handling the differenc language clauses
954
+     *  This function can be overwritten in other SPARQL dialects for the possibility of handling the differenc language clauses
955 955
      * @param string $lang
956 956
      * @return string formatted language clause
957 957
      */
@@ -1845,7 +1845,7 @@  discard block
 block discarded – undo
1845 1845
 
1846 1846
     /**
1847 1847
      * Generates a sparql query for finding the hierarchy for a concept.
1848
-	 * A concept may be a top concept in multiple schemes, returned as a single whitespace-separated literal.
1848
+     * A concept may be a top concept in multiple schemes, returned as a single whitespace-separated literal.
1849 1849
      * @param string $uri concept uri.
1850 1850
      * @param string $lang
1851 1851
      * @param string $fallback language to use if label is not available in the preferred language
@@ -1922,10 +1922,10 @@  discard block
 block discarded – undo
1922 1922
                 $ret[$uri]['exact'] = $row->exact->getUri();
1923 1923
             }
1924 1924
             if (isset($row->tops)) {
1925
-               $topConceptsList=explode(" ", $row->tops->getValue());
1926
-               // sort to garantee an alphabetical ordering of the URI
1927
-               sort($topConceptsList);
1928
-               $ret[$uri]['tops'] = $topConceptsList;
1925
+                $topConceptsList=explode(" ", $row->tops->getValue());
1926
+                // sort to garantee an alphabetical ordering of the URI
1927
+                sort($topConceptsList);
1928
+                $ret[$uri]['tops'] = $topConceptsList;
1929 1929
             }
1930 1930
             if (isset($row->children)) {
1931 1931
                 if (!isset($ret[$uri]['narrower'])) {
Please login to merge, or discard this 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.
model/ConceptProperty.php 3 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -99,17 +99,14 @@
 block discarded – undo
99 99
                             return strcoll(strtolower($a->getLabel()), strtolower($b->getLabel()));
100 100
                         }
101 101
                         return 1;
102
-                    }
103
-                    else if ($bnot == null) {
102
+                    } else if ($bnot == null) {
104 103
                         return -1;
105
-                    }
106
-                    else {
104
+                    } else {
107 105
                         // assume that notations are unique
108 106
                         return strnatcasecmp($anot, $bnot);
109 107
                     }
110 108
                 });
111
-            }
112
-            else {
109
+            } else {
113 110
                 uasort($this->values, function($a, $b) {
114 111
                     // assume that labels are unique
115 112
                     return strcoll(strtolower($a->getLabel()), strtolower($b->getLabel()));
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
             return $help;
73 73
         }
74 74
 
75
-       // if not, see if there was a comment/definition for the property in the graph
75
+        // if not, see if there was a comment/definition for the property in the graph
76 76
         if ($this->tooltip !== null) {
77 77
             return $this->tooltip;
78 78
         }
Please login to merge, or discard this 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/sparql/JenaTextSparql.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         // 1. Ensure characters with special meaning in Lucene are escaped
42 42
         $lucenemap = array();
43 43
         foreach (str_split(self::LUCENE_ESCAPE_CHARS) as $char) {
44
-            $lucenemap[$char] = '\\' . $char; // escape with a backslash
44
+            $lucenemap[$char] = '\\'.$char; // escape with a backslash
45 45
         }
46 46
         $term = strtr($term, $lucenemap);
47 47
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      * @return string sparql order by clause
93 93
      */
94 94
     private function formatOrderBy($expression, $lang) {
95
-        if(!$this->model->getConfig()->getCollationEnabled()) {
95
+        if (!$this->model->getConfig()->getCollationEnabled()) {
96 96
             return $expression;
97 97
         }
98 98
         $orderby = sprintf('arq:collation(\'%2$s\', %1$s)', $expression, $lang);
@@ -126,15 +126,15 @@  discard block
 block discarded – undo
126 126
         # make text query clause
127 127
         $lcletter = mb_strtolower($letter, 'UTF-8'); // convert to lower case, UTF-8 safe
128 128
         $langClause = $this->generateLangClause($lang);
129
-        $textcondPref = $this->createTextQueryCondition($letter . '*', 'skos:prefLabel', $langClause);
130
-        $textcondAlt = $this->createTextQueryCondition($letter . '*', 'skos:altLabel', $langClause);
131
-        $orderbyclause = $this->formatOrderBy("LCASE(?match)", $lang) . " STR(?s) LCASE(STR(?qualifier))";
129
+        $textcondPref = $this->createTextQueryCondition($letter.'*', 'skos:prefLabel', $langClause);
130
+        $textcondAlt = $this->createTextQueryCondition($letter.'*', 'skos:altLabel', $langClause);
131
+        $orderbyclause = $this->formatOrderBy("LCASE(?match)", $lang)." STR(?s) LCASE(STR(?qualifier))";
132 132
 
133
-        $qualifierClause = $qualifier ? "OPTIONAL { ?s <" . $qualifier->getURI() . "> ?qualifier }" : "";
133
+        $qualifierClause = $qualifier ? "OPTIONAL { ?s <".$qualifier->getURI()."> ?qualifier }" : "";
134 134
 
135
-        $filterDeprecated="";
136
-        if(!$showDeprecated){
137
-            $filterDeprecated="FILTER NOT EXISTS { ?s owl:deprecated true }";
135
+        $filterDeprecated = "";
136
+        if (!$showDeprecated) {
137
+            $filterDeprecated = "FILTER NOT EXISTS { ?s owl:deprecated true }";
138 138
         }
139 139
 
140 140
         $query = <<<EOQ
Please login to merge, or discard this patch.
controller/WebController.php 4 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -594,10 +594,10 @@
 block discarded – undo
594 594
     }
595 595
 
596 596
     /**
597
-    * Formats the list of concepts as labels arranged by modification month
598
-    * @param Array $changeList
599
-    * @param string $lang the language for displaying dates in the change list
600
-    */
597
+     * Formats the list of concepts as labels arranged by modification month
598
+     * @param Array $changeList
599
+     * @param string $lang the language for displaying dates in the change list
600
+     */
601 601
     public function formatChangeList($changeList, $lang)
602 602
     {
603 603
         $formatByDate = array();
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -266,11 +266,17 @@
 block discarded – undo
266 266
         $envelopeSender = $this->model->getConfig()->getFeedbackEnvelopeSender();
267 267
         // determine the sender address of the message
268 268
         $sender = $this->model->getConfig()->getFeedbackSender();
269
-        if (empty($sender)) $sender = $envelopeSender;
270
-        if (empty($sender)) $sender = $this->model->getConfig()->getFeedbackAddress();
269
+        if (empty($sender)) {
270
+          $sender = $envelopeSender;
271
+        }
272
+        if (empty($sender)) {
273
+          $sender = $this->model->getConfig()->getFeedbackAddress();
274
+        }
271 275
 
272 276
         // determine sender name - default to "anonymous user" if not given by user
273
-        if (empty($fromName)) $fromName = "anonymous user";
277
+        if (empty($fromName)) {
278
+          $fromName = "anonymous user";
279
+        }
274 280
         $headers = $this->createFeedbackHeaders($fromName, $fromEmail, $toMail, $sender);
275 281
         $params = empty($envelopeSender) ? '' : "-f $envelopeSender";
276 282
         // adding some information about the user for debugging purposes.
Please login to merge, or discard this patch.
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -234,6 +234,11 @@  discard block
 block discarded – undo
234 234
             ));
235 235
     }
236 236
 
237
+    /**
238
+     * @param string $fromName
239
+     * @param string|null $fromEmail
240
+     * @param string $sender
241
+     */
237 242
     private function createFeedbackHeaders($fromName, $fromEmail, $toMail, $sender)
238 243
     {
239 244
         $headers = "MIME-Version: 1.0" . "\r\n";
@@ -255,6 +260,7 @@  discard block
 block discarded – undo
255 260
      * @param string $fromName senders own name.
256 261
      * @param string $fromEmail senders email address.
257 262
      * @param string $fromVocab which vocabulary is the feedback related to.
263
+     * @param string $toMail
258 264
      */
259 265
     public function sendFeedback($request, $message, $messageSubject, $fromName = null, $fromEmail = null, $fromVocab = null, $toMail = null)
260 266
     {
@@ -534,6 +540,7 @@  discard block
 block discarded – undo
534 540
 
535 541
     /**
536 542
      * Invokes a very generic errorpage.
543
+     * @param string $message
537 544
      */
538 545
     public function invokeGenericErrorPage($request, $message = null)
539 546
     {
Please login to merge, or discard this 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.
controller/Honeypot.php 2 patches
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.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,16 +33,16 @@
 block discarded – undo
33 33
         // Encrypt the current time
34 34
         $honey_time_encrypted = $this->getEncryptedTime();
35 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" .
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
     /**
41
-    * Validate honeypot is empty
42
-    *
43
-    * @param  mixed $value
44
-    * @return boolean
45
-    */
41
+     * Validate honeypot is empty
42
+     *
43
+     * @param  mixed $value
44
+     * @return boolean
45
+     */
46 46
     public function validateHoneypot($value) : bool
47 47
     {
48 48
         if ($this->disabled) {
Please login to merge, or discard this patch.