Passed
Push — main ( a07285...1b25e2 )
by Osma
18:03 queued 13:47
created
src/model/PluginRegister.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
                         $ret[$name] = $files[$type];
63 63
                     } else {
64 64
                         foreach ($files[$type] as $file) {
65
-                            array_push($ret[$name], 'plugins/' . $name . '/' . $file);
65
+                            array_push($ret[$name], 'plugins/'.$name.'/'.$file);
66 66
                         }
67 67
                     }
68 68
                 }
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     protected function flatten($array)
164 164
     {
165 165
         $return = array();
166
-        array_walk_recursive($array, function ($a) use (&$return) { $return[] = $a; });
166
+        array_walk_recursive($array, function($a) use (&$return) { $return[] = $a; });
167 167
         return $return;
168 168
     }
169 169
 
Please login to merge, or discard this patch.
src/model/sparql/GenericSparql.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     {
97 97
         $queryId = sprintf("%05d", rand(0, 99999));
98 98
         $logger = $this->model->getLogger();
99
-        $logger->info("[qid $queryId] SPARQL query:\n" . $this->generateQueryPrefixes($query) . "\n$query\n");
99
+        $logger->info("[qid $queryId] SPARQL query:\n".$this->generateQueryPrefixes($query)."\n$query\n");
100 100
         $starttime = microtime(true);
101 101
         $result = $this->client->query($query);
102 102
         $elapsed = intval(round((microtime(true) - $starttime) * 1000));
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      */
119 119
     protected function query($query)
120 120
     {
121
-        $key = $this->endpoint . " " . $query;
121
+        $key = $this->endpoint." ".$query;
122 122
         if (!array_key_exists($key, self::$querycache)) {
123 123
             self::$querycache[$key] = $this->doQuery($query);
124 124
         }
@@ -281,9 +281,9 @@  discard block
 block discarded – undo
281 281
         $gcl = $this->graphClause;
282 282
         $classes = ($classes) ? $classes : array('http://www.w3.org/2004/02/skos/core#Concept');
283 283
 
284
-        $quote_string = function ($val) { return "'$val'"; };
284
+        $quote_string = function($val) { return "'$val'"; };
285 285
         $quoted_values = array_map($quote_string, $langs);
286
-        $langFilter = "FILTER(?lang IN (" . implode(',', $quoted_values) . "))";
286
+        $langFilter = "FILTER(?lang IN (".implode(',', $quoted_values)."))";
287 287
 
288 288
         $values = $this->formatValues('?type', $classes, 'uri');
289 289
         $valuesProp = $this->formatValues('?prop', $props, null);
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
             $values[] = "<$graph>";
816 816
         }
817 817
         if (count($values)) {
818
-            return "FILTER (?graph IN (" . implode(',', $values) . "))";
818
+            return "FILTER (?graph IN (".implode(',', $values)."))";
819 819
         }
820 820
     }
821 821
 
@@ -827,16 +827,16 @@  discard block
 block discarded – undo
827 827
      */
828 828
     protected function formatLimitAndOffset($limit, $offset)
829 829
     {
830
-        $limit = ($limit) ? 'LIMIT ' . $limit : '';
831
-        $offset = ($offset) ? 'OFFSET ' . $offset : '';
830
+        $limit = ($limit) ? 'LIMIT '.$limit : '';
831
+        $offset = ($offset) ? 'OFFSET '.$offset : '';
832 832
         // eliminating whitespace and line changes when the conditions aren't needed.
833 833
         $limitandoffset = '';
834 834
         if ($limit && $offset) {
835
-            $limitandoffset = "\n" . $limit . "\n" . $offset;
835
+            $limitandoffset = "\n".$limit."\n".$offset;
836 836
         } elseif ($limit) {
837
-            $limitandoffset = "\n" . $limit;
837
+            $limitandoffset = "\n".$limit;
838 838
         } elseif ($offset) {
839
-            $limitandoffset = "\n" . $offset;
839
+            $limitandoffset = "\n".$offset;
840 840
         }
841 841
 
842 842
         return $limitandoffset;
@@ -992,14 +992,14 @@  discard block
 block discarded – undo
992 992
         // if search language and UI/display language differ, must also consider case where there is no prefLabel in
993 993
         // the display language; in that case, should use the label with the same language as the matched label
994 994
         $labelcondFallback = ($searchLang != $lang) ?
995
-          "OPTIONAL { # in case previous OPTIONAL block gives no labels\n" .
995
+          "OPTIONAL { # in case previous OPTIONAL block gives no labels\n".
996 996
           "?s skos:prefLabel ?label . FILTER (LANGMATCHES(LANG(?label), LANG(?match))) }" : "";
997 997
 
998 998
         //  Including the labels if there is no query term given.
999 999
         if ($rawterm === '') {
1000 1000
             $labelClause = "?s skos:prefLabel ?label .";
1001
-            $labelClause = ($lang) ? $labelClause . " FILTER (LANGMATCHES(LANG(?label), '$lang'))" : $labelClause . "";
1002
-            return $labelClause . " BIND(?label AS ?match)";
1001
+            $labelClause = ($lang) ? $labelClause." FILTER (LANGMATCHES(LANG(?label), '$lang'))" : $labelClause."";
1002
+            return $labelClause." BIND(?label AS ?match)";
1003 1003
         }
1004 1004
 
1005 1005
         /*
@@ -1083,9 +1083,9 @@  discard block
 block discarded – undo
1083 1083
             $filterDeprecated = "FILTER NOT EXISTS { ?s owl:deprecated true }";
1084 1084
         }
1085 1085
         // extra conditions for parent and group, if specified
1086
-        $parentcond = ($params->getParentLimit()) ? "?s skos:broader+ <" . $params->getParentLimit() . "> ." : "";
1087
-        $groupcond = ($params->getGroupLimit()) ? "<" . $params->getGroupLimit() . "> skos:member ?s ." : "";
1088
-        $pgcond = $parentcond . $groupcond;
1086
+        $parentcond = ($params->getParentLimit()) ? "?s skos:broader+ <".$params->getParentLimit()."> ." : "";
1087
+        $groupcond = ($params->getGroupLimit()) ? "<".$params->getGroupLimit()."> skos:member ?s ." : "";
1088
+        $pgcond = $parentcond.$groupcond;
1089 1089
 
1090 1090
         $orderextra = $this->isDefaultEndpoint() ? $this->graph : '';
1091 1091
 
@@ -1173,7 +1173,7 @@  discard block
 block discarded – undo
1173 1173
 
1174 1174
         if (!empty($fields)) {
1175 1175
             foreach ($fields as $prop) {
1176
-                $propname = $prop . 's';
1176
+                $propname = $prop.'s';
1177 1177
                 if (isset($row->$propname)) {
1178 1178
                     foreach (explode("\n", $row->$propname->getValue()) as $line) {
1179 1179
                         $rdata = str_getcsv($line, ',', '"', '"');
@@ -1188,7 +1188,7 @@  discard block
 block discarded – undo
1188 1188
                             $propvals = $rdata[2];
1189 1189
                         }
1190 1190
 
1191
-                        $hit['skos:' . $prop][] = $propvals;
1191
+                        $hit['skos:'.$prop][] = $propvals;
1192 1192
                     }
1193 1193
                 }
1194 1194
             }
@@ -1323,7 +1323,7 @@  discard block
 block discarded – undo
1323 1323
         $conditions = $this->formatFilterConditions($letter, $lang);
1324 1324
         $filtercondLabel = $conditions['filterpref'];
1325 1325
         $filtercondALabel = $conditions['filteralt'];
1326
-        $qualifierClause = $qualifier ? "OPTIONAL { ?s <" . $qualifier->getURI() . "> ?qualifier }" : "";
1326
+        $qualifierClause = $qualifier ? "OPTIONAL { ?s <".$qualifier->getURI()."> ?qualifier }" : "";
1327 1327
         $filterDeprecated = "";
1328 1328
         if (!$showDeprecated) {
1329 1329
             $filterDeprecated = "FILTER NOT EXISTS { ?s owl:deprecated true }";
@@ -1820,7 +1820,7 @@  discard block
 block discarded – undo
1820 1820
                 if (!isset($row->label) || $row->label->getLang() === $lang) {
1821 1821
                     $ret[$row->object->getUri()] = $val;
1822 1822
                 } elseif ($row->label->getLang() === $fallbacklang) {
1823
-                    $val['label'] .= ' (' . $row->label->getLang() . ')';
1823
+                    $val['label'] .= ' ('.$row->label->getLang().')';
1824 1824
                     $ret[$row->object->getUri()] = $val;
1825 1825
                 }
1826 1826
             }
@@ -1919,10 +1919,10 @@  discard block
 block discarded – undo
1919 1919
 
1920 1920
             $label = null;
1921 1921
             if (isset($row->label)) {
1922
-                if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang . "-") == 0) {
1922
+                if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang."-") == 0) {
1923 1923
                     $label = $row->label->getValue();
1924 1924
                 } else {
1925
-                    $label = $row->label->getValue() . " (" . $row->label->getLang() . ")";
1925
+                    $label = $row->label->getValue()." (".$row->label->getLang().")";
1926 1926
                 }
1927 1927
 
1928 1928
             }
@@ -2000,8 +2000,8 @@  discard block
 block discarded – undo
2000 2000
         foreach ($result as $row) {
2001 2001
             if (isset($row->top) && isset($row->label)) {
2002 2002
                 $label = $row->label->getValue();
2003
-                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang . "-") !== 0) {
2004
-                    $label .= ' (' . $row->label->getLang() . ')';
2003
+                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang."-") !== 0) {
2004
+                    $label .= ' ('.$row->label->getLang().')';
2005 2005
                 }
2006 2006
                 $top = array('uri' => $row->top->getUri(), 'topConceptOf' => $row->topuri->getUri(), 'label' => $label, 'hasChildren' => filter_var($row->children->getValue(), FILTER_VALIDATE_BOOLEAN));
2007 2007
                 if (isset($row->notation)) {
@@ -2108,8 +2108,8 @@  discard block
 block discarded – undo
2108 2108
                 $label = null;
2109 2109
                 if (isset($row->childlabel)) {
2110 2110
                     $label = $row->childlabel->getValue();
2111
-                    if ($row->childlabel->getLang() !== $lang && strpos($row->childlabel->getLang(), $lang . "-") !== 0) {
2112
-                        $label .= " (" . $row->childlabel->getLang() . ")";
2111
+                    if ($row->childlabel->getLang() !== $lang && strpos($row->childlabel->getLang(), $lang."-") !== 0) {
2112
+                        $label .= " (".$row->childlabel->getLang().")";
2113 2113
                     }
2114 2114
 
2115 2115
                 }
@@ -2130,8 +2130,8 @@  discard block
 block discarded – undo
2130 2130
             }
2131 2131
             if (isset($row->label)) {
2132 2132
                 $preflabel = $row->label->getValue();
2133
-                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang . "-") !== 0) {
2134
-                    $preflabel .= ' (' . $row->label->getLang() . ')';
2133
+                if ($row->label->getLang() && $row->label->getLang() !== $lang && strpos($row->label->getLang(), $lang."-") !== 0) {
2134
+                    $preflabel .= ' ('.$row->label->getLang().')';
2135 2135
                 }
2136 2136
 
2137 2137
                 $ret[$uri]['prefLabel'] = $preflabel;
@@ -2298,10 +2298,10 @@  discard block
 block discarded – undo
2298 2298
                     'type' => array($row->type->shorten()),
2299 2299
                 );
2300 2300
                 if (isset($row->label)) {
2301
-                    if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang . "-") == 0) {
2301
+                    if ($row->label->getLang() == $lang || strpos($row->label->getLang(), $lang."-") == 0) {
2302 2302
                         $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue();
2303 2303
                     } else {
2304
-                        $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue() . " (" . $row->label->getLang() . ")";
2304
+                        $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue()." (".$row->label->getLang().")";
2305 2305
                     }
2306 2306
 
2307 2307
                 }
@@ -2348,7 +2348,7 @@  discard block
 block discarded – undo
2348 2348
     private function generateChangeListQuery($prop, $lang, $offset, $limit = 200, $showDeprecated = false)
2349 2349
     {
2350 2350
         $fcl = $this->generateFromClause();
2351
-        $offset = ($offset) ? 'OFFSET ' . $offset : '';
2351
+        $offset = ($offset) ? 'OFFSET '.$offset : '';
2352 2352
 
2353 2353
         //Additional clauses when deprecated concepts need to be included in the results
2354 2354
         $deprecatedOptions = '';
Please login to merge, or discard this patch.
src/model/Vocabulary.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             return $lname;
105 105
         }
106 106
         // already a full URI
107
-        return $this->getUriSpace() . $lname;
107
+        return $this->getUriSpace().$lname;
108 108
     }
109 109
 
110 110
     /**
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
             $result = $sparql->queryConceptScheme($defaultcs);
167 167
         } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) {
168 168
             if ($this->model->getConfig()->getLogCaughtExceptions()) {
169
-                error_log('Caught exception: ' . $e->getMessage());
169
+                error_log('Caught exception: '.$e->getMessage());
170 170
             }
171 171
             return null;
172 172
         }
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
                 foreach ($conceptscheme->allLiterals($prop, null) as $val) {
200 200
                     $prop = (substr($prop, 0, 5) == 'dc11:') ? str_replace('dc11:', 'dc:', $prop) : $prop;
201 201
                     if ($val->getValue() instanceof DateTime) {
202
-                        $val = Punic\Calendar::formatDate($val->getValue(), 'full', $lang) . ' ' . Punic\Calendar::format($val->getValue(), 'HH:mm:ss', $lang);
202
+                        $val = Punic\Calendar::formatDate($val->getValue(), 'full', $lang).' '.Punic\Calendar::format($val->getValue(), 'HH:mm:ss', $lang);
203 203
                     }
204 204
                     $ret[$prop][] = $val;
205 205
                 }
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
             $conceptSchemes = $this->getSparql()->queryConceptSchemes($lang);
257 257
         } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) {
258 258
             if ($this->model->getConfig()->getLogCaughtExceptions()) {
259
-                error_log('Caught exception: ' . $e->getMessage());
259
+                error_log('Caught exception: '.$e->getMessage());
260 260
             }
261 261
         }
262 262
         return $conceptSchemes;
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
         }
328 328
         // don't know how to parse
329 329
         $rev = $parts[2];
330
-        $datestr = $parts[3] . ' ' . $parts[4];
330
+        $datestr = $parts[3].' '.$parts[4];
331 331
 
332 332
         return "$datestr (r$rev)";
333 333
     }
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
             $conceptInfo = $sparql->queryConceptInfo([$uri], $this->config->getArrayClassURI(), array($this), $clang);
458 458
         } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) {
459 459
             if ($this->model->getConfig()->getLogCaughtExceptions()) {
460
-                error_log('Caught exception: ' . $e->getMessage());
460
+                error_log('Caught exception: '.$e->getMessage());
461 461
             }
462 462
         }
463 463
         if (!$conceptInfo) {
Please login to merge, or discard this patch.
src/model/ConceptProperty.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public function getDescription()
81 81
     {
82
-        $helpprop = $this->prop . "_help";
82
+        $helpprop = $this->prop."_help";
83 83
 
84 84
         // see if we have a translation with the help text
85 85
         $help = $this->model->getText($helpprop);
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
     public function addValue($value)
112 112
     {
113
-        $this->values[ltrim($value->getNotation() . ' ') . $value->getLabel(allowExternal: false) . rtrim(' ' . $value->getUri())] = $value;
113
+        $this->values[ltrim($value->getNotation().' ').$value->getLabel(allowExternal: false).rtrim(' '.$value->getUri())] = $value;
114 114
         $this->is_sorted = false;
115 115
     }
116 116
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         # Note that getLabel() returns URIs in case of no label and may return a prefixed value which affects sorting
121 121
         if (!empty($this->values)) {
122 122
             if ($this->sort_by_notation) {
123
-                uasort($this->values, function ($a, $b) {
123
+                uasort($this->values, function($a, $b) {
124 124
                     $anot = $a->getNotation();
125 125
                     $bnot = $b->getNotation();
126 126
                     if ($anot == null) {
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                     }
142 142
                 });
143 143
             } else {
144
-                uasort($this->values, function ($a, $b) {
144
+                uasort($this->values, function($a, $b) {
145 145
                     // assume that sort keys are unique
146 146
                     return strcoll($a->getSortKey(), $b->getSortKey());
147 147
                 });
Please login to merge, or discard this patch.
src/model/ConceptMappingPropertyValue.php 1 patch
Spacing   +10 added lines, -10 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()
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
     public function getLabel($lang = '', $allowExternal = true)
48 48
     {
49
-        $key = $lang . "/" . ($allowExternal ? "true" : "false");
49
+        $key = $lang."/".($allowExternal ? "true" : "false");
50 50
         if (isset($this->labelcache[$key])) {
51 51
             return $this->labelcache[$key];
52 52
         }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
     public function getSortKey()
60 60
     {
61
-        return strtolower($this->getVocabName() . ": " . $this->getLabel());
61
+        return strtolower($this->getVocabName().": ".$this->getLabel());
62 62
     }
63 63
 
64 64
     private function queryLabel($lang = '', $allowExternal = true)
@@ -187,25 +187,25 @@  discard block
 block discarded – undo
187 187
             'from' => [
188 188
                 'memberSet' => [
189 189
                     [
190
-                        'uri' => (string) $this->source->getUri(),
190
+                        'uri' => (string)$this->source->getUri(),
191 191
                     ]
192 192
                 ]
193 193
             ],
194 194
             'to' => [
195 195
                 'memberSet' => [
196 196
                     [
197
-                        'uri' => (string) $this->getUri()
197
+                        'uri' => (string)$this->getUri()
198 198
                     ]
199 199
                 ]
200 200
             ],
201 201
             // EXTRA
202 202
             'hrefLink' => $hrefLink, // link to resource as displayed in the UI
203 203
             'lang' => $propertyLang, // TBD: could it be part of the prefLabel?
204
-            'vocabName' => (string) $this->getVocabName(), // vocabulary as displayed in the UI
204
+            'vocabName' => (string)$this->getVocabName(), // vocabulary as displayed in the UI
205 205
             'typeLabel' => $this->model->getText($this->type), // a text used in the UI instead of, for example, skos:closeMatch
206 206
         ];
207 207
 
208
-        $helpprop = $this->type . "_help";
208
+        $helpprop = $this->type."_help";
209 209
         // see if we have a translation for the property help text
210 210
         $help = $this->model->getText($helpprop);
211 211
         if ($help != $helpprop) {
@@ -215,20 +215,20 @@  discard block
 block discarded – undo
215 215
         $fromScheme = $this->vocab->getDefaultConceptScheme();
216 216
         if (isset($fromScheme)) {
217 217
             $ret['fromScheme'] = [
218
-                'uri' => (string) $fromScheme,
218
+                'uri' => (string)$fromScheme,
219 219
             ];
220 220
         }
221 221
 
222 222
         $exvocab = $this->getExvocab();
223 223
         if (isset($exvocab)) {
224 224
             $ret['toScheme'] = [
225
-                'uri' => (string) $exvocab->getDefaultConceptScheme(),
225
+                'uri' => (string)$exvocab->getDefaultConceptScheme(),
226 226
             ];
227 227
         }
228 228
 
229 229
         $notation = $this->getNotation();
230 230
         if (isset($notation)) {
231
-            $ret['to']['memberSet'][0]['notation'] = (string) $notation;
231
+            $ret['to']['memberSet'][0]['notation'] = (string)$notation;
232 232
         }
233 233
 
234 234
         $label = $this->getLabel($lang, $allowExternal);
Please login to merge, or discard this patch.
src/controller/GlobalUrlExtension.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,14 +27,14 @@  discard block
 block discarded – undo
27 27
 
28 28
         // Build base URL
29 29
         if ($vocabid && $vocabid !== '') {
30
-            $url = $vocabid . '/';
30
+            $url = $vocabid.'/';
31 31
         }
32 32
 
33 33
         $url .= $lang;
34 34
 
35 35
         // Add page suffix for non-home pages
36 36
         if ($page !== 'home') {
37
-            $url .= '/' . $page;
37
+            $url .= '/'.$page;
38 38
         }
39 39
 
40 40
         // Build query parameters
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
         // Append parameters if any
54 54
         if (!empty($params)) {
55
-            $url .= '?' . http_build_query($params);
55
+            $url .= '?'.http_build_query($params);
56 56
         }
57 57
 
58 58
         return $url;
Please login to merge, or discard this patch.
src/controller/WebController.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
         }
38 38
 
39 39
         // specify where to look for templates and cache
40
-        $loader = new \Twig\Loader\FilesystemLoader([__DIR__ . '/../../custom-templates', __DIR__ . '/../view']);
40
+        $loader = new \Twig\Loader\FilesystemLoader([__DIR__.'/../../custom-templates', __DIR__.'/../view']);
41 41
         // initialize Twig environment
42
-        $this->twig = new \Twig\Environment($loader, array('cache' => $tmpDir,'auto_reload' => true));
42
+        $this->twig = new \Twig\Environment($loader, array('cache' => $tmpDir, 'auto_reload' => true));
43 43
         // used for setting the base href for the relative urls
44 44
         $this->twig->addGlobal("BaseHref", $this->getBaseHref());
45 45
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         $this->twig->addExtension(new LinkUrlExtension($model));
57 57
 
58 58
         // register a Twig filter for generating strings from language codes with CLDR
59
-        $langFilter = new \Twig\TwigFilter('lang_name', function ($langcode, $lang) {
59
+        $langFilter = new \Twig\TwigFilter('lang_name', function($langcode, $lang) {
60 60
             return Language::getName($langcode, $lang);
61 61
         });
62 62
         $this->twig->addFilter($langFilter);
@@ -83,16 +83,16 @@  discard block
 block discarded – undo
83 83
      */
84 84
     public function findCustomTemplates($dir)
85 85
     {
86
-        $customTemplateSubDirs = glob($dir . '/*', GLOB_ONLYDIR);
86
+        $customTemplateSubDirs = glob($dir.'/*', GLOB_ONLYDIR);
87 87
         $customTemplates = [];
88 88
 
89 89
         foreach ($customTemplateSubDirs as $slotDir) {
90 90
             $slotName = basename($slotDir);
91
-            $files = glob($slotDir . '/*.twig');
91
+            $files = glob($slotDir.'/*.twig');
92 92
             // Strip the directory part to make the file paths relative to the directory.
93 93
             // The "custom-templates" directory is registered to the Twig FilesystemLoader.
94
-            $customTemplates[$slotName] = array_map(function ($file) use ($dir) {
95
-                return str_replace($dir . '/', '', $file);
94
+            $customTemplates[$slotName] = array_map(function($file) use ($dir) {
95
+                return str_replace($dir.'/', '', $file);
96 96
             }, $files);
97 97
         }
98 98
 
@@ -269,16 +269,16 @@  discard block
 block discarded – undo
269 269
 
270 270
     private function createFeedbackHeaders($fromName, $fromEmail, $toMail, $sender)
271 271
     {
272
-        $headers = "MIME-Version: 1.0" . "\r\n";
273
-        $headers .= "Content-type: text/html; charset=UTF-8" . "\r\n";
272
+        $headers = "MIME-Version: 1.0"."\r\n";
273
+        $headers .= "Content-type: text/html; charset=UTF-8"."\r\n";
274 274
         if (!empty($toMail)) {
275
-            $headers .= "Cc: " . $this->model->getConfig()->getFeedbackAddress() . "\r\n";
275
+            $headers .= "Cc: ".$this->model->getConfig()->getFeedbackAddress()."\r\n";
276 276
         }
277 277
         if (!empty($fromEmail)) {
278 278
             $headers .= "Reply-To: $fromName <$fromEmail>\r\n";
279 279
         }
280 280
         $service = $this->model->getConfig()->getServiceName();
281
-        return $headers . "From: $fromName via $service <$sender>";
281
+        return $headers."From: $fromName via $service <$sender>";
282 282
     }
283 283
 
284 284
     /**
@@ -292,9 +292,9 @@  discard block
 block discarded – undo
292 292
     public function sendFeedback($request, $message, $messageSubject, $fromName = null, $fromEmail = null, $fromVocab = null, $toMail = null)
293 293
     {
294 294
         $toAddress = ($toMail) ? $toMail : $this->model->getConfig()->getFeedbackAddress();
295
-        $messageSubject = "[" . $this->model->getConfig()->getServiceName() . "] " . $messageSubject;
295
+        $messageSubject = "[".$this->model->getConfig()->getServiceName()."] ".$messageSubject;
296 296
         if ($fromVocab !== null && $fromVocab !== '') {
297
-            $message = 'Feedback from vocab: ' . strtoupper($fromVocab) . "<br />" . $message;
297
+            $message = 'Feedback from vocab: '.strtoupper($fromVocab)."<br />".$message;
298 298
         }
299 299
         $envelopeSender = $this->model->getConfig()->getFeedbackEnvelopeSender();
300 300
         // determine the sender address of the message
@@ -313,10 +313,10 @@  discard block
 block discarded – undo
313 313
         $headers = $this->createFeedbackHeaders($fromName, $fromEmail, $toMail, $sender);
314 314
         $params = empty($envelopeSender) ? '' : "-f $envelopeSender";
315 315
         // adding some information about the user for debugging purposes.
316
-        $message = $message . "<br /><br /> Debugging information:"
317
-            . "<br />Timestamp: " . date(DATE_RFC2822)
318
-            . "<br />User agent: " . $request->getServerConstant('HTTP_USER_AGENT')
319
-            . "<br />Referer: " . $request->getServerConstant('HTTP_REFERER');
316
+        $message = $message."<br /><br /> Debugging information:"
317
+            . "<br />Timestamp: ".date(DATE_RFC2822)
318
+            . "<br />User agent: ".$request->getServerConstant('HTTP_USER_AGENT')
319
+            . "<br />Referer: ".$request->getServerConstant('HTTP_REFERER');
320 320
 
321 321
         try {
322 322
             mail($toAddress, $messageSubject, $message, $headers, $params);
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
             header("HTTP/1.0 404 Not Found");
325 325
             $template = $this->twig->load('error.twig');
326 326
             if ($this->model->getConfig()->getLogCaughtExceptions()) {
327
-                error_log('Caught exception: ' . $e->getMessage());
327
+                error_log('Caught exception: '.$e->getMessage());
328 328
             }
329 329
 
330 330
             echo $template->render(
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
                 } catch (ValueError $e) {
378 378
                     // fail fast with an error page if the vocabulary cannot be found
379 379
                     if ($this->model->getConfig()->getLogCaughtExceptions()) {
380
-                        error_log('Caught exception: ' . $e->getMessage());
380
+                        error_log('Caught exception: '.$e->getMessage());
381 381
                     }
382 382
                     header("HTTP/1.0 400 Bad Request");
383 383
                     $this->invokeGenericErrorPage($request, $e->getMessage());
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
             $errored = true;
400 400
             header("HTTP/1.0 500 Internal Server Error");
401 401
             if ($this->model->getConfig()->getLogCaughtExceptions()) {
402
-                error_log('Caught exception: ' . $e->getMessage());
402
+                error_log('Caught exception: '.$e->getMessage());
403 403
             }
404 404
         }
405 405
         $vocabList = $this->model->getVocabularyList();
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
         } catch (Exception $e) {
440 440
             header("HTTP/1.0 500 Internal Server Error");
441 441
             if ($this->model->getConfig()->getLogCaughtExceptions()) {
442
-                error_log('Caught exception: ' . $e->getMessage());
442
+                error_log('Caught exception: '.$e->getMessage());
443 443
             }
444 444
 
445 445
             echo $template->render(
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
         } catch (Exception $e) {
465 465
             header("HTTP/1.0 404 Not Found");
466 466
             if ($this->model->getConfig()->getLogCaughtExceptions()) {
467
-                error_log('Caught exception: ' . $e->getMessage());
467
+                error_log('Caught exception: '.$e->getMessage());
468 468
             }
469 469
 
470 470
             echo $template->render(
Please login to merge, or discard this patch.