Passed
Pull Request — master (#1412)
by Jakob
04:10
created
model/Vocabulary.php 3 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,10 +76,12 @@
 block discarded – undo
76 76
      */
77 77
     public function getUriSpace()
78 78
     {
79
-        if ($this->urispace === null) // initialize cache
79
+        if ($this->urispace === null) {
80
+          // initialize cache
80 81
         {
81 82
             $this->urispace = $this->resource->getLiteral('void:uriSpace')->getValue();
82 83
         }
84
+        }
83 85
 
84 86
         return $this->urispace;
85 87
     }
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -163,10 +163,10 @@  discard block
 block discarded – undo
163 163
             $sparql = $this->getSparql();
164 164
             $result = $sparql->queryConceptScheme($defaultcs);
165 165
         } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) {
166
-             if ($this->model->getConfig()->getLogCaughtExceptions()) {
167
-                 error_log('Caught exception: ' . $e->getMessage());
168
-             }
169
-             return null;
166
+              if ($this->model->getConfig()->getLogCaughtExceptions()) {
167
+                  error_log('Caught exception: ' . $e->getMessage());
168
+              }
169
+              return null;
170 170
         }
171 171
         $conceptscheme = $result->resource($defaultcs);
172 172
         $this->order = array(
@@ -253,9 +253,9 @@  discard block
 block discarded – undo
253 253
         try {
254 254
             $conceptSchemes = $this->getSparql()->queryConceptSchemes($lang);
255 255
         } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) {
256
-             if ($this->model->getConfig()->getLogCaughtExceptions()) {
257
-                 error_log('Caught exception: ' . $e->getMessage());
258
-             }
256
+              if ($this->model->getConfig()->getLogCaughtExceptions()) {
257
+                  error_log('Caught exception: ' . $e->getMessage());
258
+              }
259 259
         }
260 260
         return $conceptSchemes;
261 261
     }
@@ -453,9 +453,9 @@  discard block
 block discarded – undo
453 453
         try {
454 454
             $conceptInfo = $sparql->queryConceptInfo($uri, $this->config->getArrayClassURI(), array($this), $clang);
455 455
         } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) {
456
-             if ($this->model->getConfig()->getLogCaughtExceptions()) {
457
-                 error_log('Caught exception: ' . $e->getMessage());
458
-             }
456
+              if ($this->model->getConfig()->getLogCaughtExceptions()) {
457
+                  error_log('Caught exception: ' . $e->getMessage());
458
+              }
459 459
         }
460 460
         return $conceptInfo;
461 461
     }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             return $lname;
103 103
         }
104 104
         // already a full URI
105
-        return $this->getUriSpace() . $lname;
105
+        return $this->getUriSpace().$lname;
106 106
     }
107 107
 
108 108
     /**
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
             $result = $sparql->queryConceptScheme($defaultcs);
165 165
         } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) {
166 166
              if ($this->model->getConfig()->getLogCaughtExceptions()) {
167
-                 error_log('Caught exception: ' . $e->getMessage());
167
+                 error_log('Caught exception: '.$e->getMessage());
168 168
              }
169 169
              return null;
170 170
         }
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
                 foreach ($conceptscheme->allLiterals($prop, null) as $val) {
198 198
                     $prop = (substr($prop, 0, 5) == 'dc11:') ? str_replace('dc11:', 'dc:', $prop) : $prop;
199 199
                     if ($val->getValue() instanceof DateTime) {
200
-                        $val = Punic\Calendar::formatDate($val->getValue(), 'full', $lang) . ' ' . Punic\Calendar::format($val->getValue(), 'HH:mm:ss', $lang);
200
+                        $val = Punic\Calendar::formatDate($val->getValue(), 'full', $lang).' '.Punic\Calendar::format($val->getValue(), 'HH:mm:ss', $lang);
201 201
                     }
202 202
                     $ret[$prop][] = $val;
203 203
                 }
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
             $conceptSchemes = $this->getSparql()->queryConceptSchemes($lang);
255 255
         } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) {
256 256
              if ($this->model->getConfig()->getLogCaughtExceptions()) {
257
-                 error_log('Caught exception: ' . $e->getMessage());
257
+                 error_log('Caught exception: '.$e->getMessage());
258 258
              }
259 259
         }
260 260
         return $conceptSchemes;
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
         }
326 326
         // don't know how to parse
327 327
         $rev = $parts[2];
328
-        $datestr = $parts[3] . ' ' . $parts[4];
328
+        $datestr = $parts[3].' '.$parts[4];
329 329
 
330 330
         return "$datestr (r$rev)";
331 331
     }
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
      * @param string $array the uri of the concept array class, eg. isothes:ThesaurusArray
337 337
      * @param string $group the uri of the  concept group class, eg. isothes:ConceptGroup
338 338
      */
339
-    public function getStatistics($lang = '', $array=null, $group=null)
339
+    public function getStatistics($lang = '', $array = null, $group = null)
340 340
     {
341 341
         $sparql = $this->getSparql();
342 342
         // find the number of concepts
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
             $conceptInfo = $sparql->queryConceptInfo($uri, $this->config->getArrayClassURI(), array($this), $clang);
455 455
         } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) {
456 456
              if ($this->model->getConfig()->getLogCaughtExceptions()) {
457
-                 error_log('Caught exception: ' . $e->getMessage());
457
+                 error_log('Caught exception: '.$e->getMessage());
458 458
              }
459 459
         }
460 460
         return $conceptInfo;
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
         return $this->getSparql()->queryChangeList($prop, $clang, $offset, $limit, $showDeprecated);
666 666
     }
667 667
 
668
-    public function getTitle($lang=null) {
668
+    public function getTitle($lang = null) {
669 669
       return $this->config->getTitle($lang);
670 670
     }
671 671
 
Please login to merge, or discard this patch.
rest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     } elseif ($parts[1] == 'data') {
38 38
         $controller->data($request);
39 39
     } elseif (sizeof($parts) == 2) {
40
-        header("Location: " . $parts[1] . "/");
40
+        header("Location: ".$parts[1]."/");
41 41
     } else {
42 42
         $vocab = $parts[1];
43 43
         try {
@@ -93,5 +93,5 @@  discard block
 block discarded – undo
93 93
     }
94 94
 } catch (Exception $e) {
95 95
     header("HTTP/1.0 500 Internal Server Error");
96
-    echo('ERROR: ' . $e->getMessage());
96
+    echo('ERROR: '.$e->getMessage());
97 97
 }
Please login to merge, or discard this patch.
entity.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,5 +23,5 @@
 block discarded – undo
23 23
 
24 24
 } catch (Exception $e) {
25 25
     header("HTTP/1.0 500 Internal Server Error");
26
-    echo('ERROR: ' . $e->getMessage());
26
+    echo('ERROR: '.$e->getMessage());
27 27
 }
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     }
15 15
     require_once 'vendor/autoload.php';
16 16
 } catch (Exception $e) {
17
-    echo "Error: " . $e->getMessage();
17
+    echo "Error: ".$e->getMessage();
18 18
     return;
19 19
 }
20 20
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     // if language code missing, redirect to guessed language
33 33
     // in any case, redirect to <lang>/
34 34
     $lang = sizeof($parts) == 2 && $parts[1] !== '' ? $parts[1] : $controller->guessLanguage();
35
-    header("Location: " . $lang . "/");
35
+    header("Location: ".$lang."/");
36 36
 } else {
37 37
   if (array_key_exists($parts[1], $config->getLanguages())) { // global pages
38 38
         $request->setLang($parts[1]);
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
         }
62 62
         if (sizeof($parts) == 3) { // language code missing
63 63
             $lang = $controller->guessLanguage();
64
-            $newurl = $controller->getBaseHref() . $vocab . "/" . $lang . "/";
65
-            header("Location: " . $newurl);
64
+            $newurl = $controller->getBaseHref().$vocab."/".$lang."/";
65
+            header("Location: ".$newurl);
66 66
         } else {
67 67
             if (array_key_exists($parts[2], $config->getLanguages())) {
68 68
                 $lang = $parts[2];
@@ -103,10 +103,10 @@  discard block
 block discarded – undo
103 103
                 }
104 104
             } else { // language code missing, redirect to some language version
105 105
                 $lang = $controller->guessLanguage($vocab);
106
-                $newurl = $controller->getBaseHref() . $vocab . "/" . $lang . "/" . implode('/', array_slice($parts, 2));
106
+                $newurl = $controller->getBaseHref().$vocab."/".$lang."/".implode('/', array_slice($parts, 2));
107 107
                 $qs = $request->getServerConstant('QUERY_STRING');
108 108
                 if ($qs) {
109
-                    $newurl .= "?" . $qs;
109
+                    $newurl .= "?".$qs;
110 110
                 }
111 111
                 header("Location: $newurl");
112 112
             }
Please login to merge, or discard this patch.
model/DataObject.php 3 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,10 +79,12 @@
 block discarded – undo
79 79
         if ($sortable !== null) {
80 80
             uksort($sortable, array($this, 'mycompare'));
81 81
             foreach ($sortable as $prop => $vals) {
82
-                if (is_array($prop)) // the ConceptProperty objects have their own sorting methods
82
+                if (is_array($prop)) {
83
+                  // the ConceptProperty objects have their own sorting methods
83 84
                 {
84 85
                     ksort($sortable[$prop]);
85 86
                 }
87
+                }
86 88
             }
87 89
         }
88 90
         return $sortable;
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,8 +124,8 @@
 block discarded – undo
124 124
      */
125 125
     public function getEnvLang()
126 126
     {
127
-       // get language from locale, same as used by gettext, set by Controller
128
-       return substr(getenv("LC_ALL"), 0, 2); // @codeCoverageIgnore
127
+        // get language from locale, same as used by gettext, set by Controller
128
+        return substr(getenv("LC_ALL"), 0, 2); // @codeCoverageIgnore
129 129
     }
130 130
 
131 131
     /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
                 return isset($results[$lang]) ? $results[$lang] : null;
53 53
             } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) {
54 54
                 if ($this->model->getConfig()->getLogCaughtExceptions()) {
55
-                    error_log('Caught exception: ' . $e->getMessage());
55
+                    error_log('Caught exception: '.$e->getMessage());
56 56
                 }
57 57
             }
58 58
         }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
                 return isset($results) ? $results : null;
75 75
             } catch (EasyRdf\Http\Exception | EasyRdf\Exception | Throwable $e) {
76 76
                 if ($this->model->getConfig()->getLogCaughtExceptions()) {
77
-                    error_log('Caught exception: ' . $e->getMessage());
77
+                    error_log('Caught exception: '.$e->getMessage());
78 78
                 }
79 79
             }
80 80
         }
Please login to merge, or discard this patch.
controller/RestController.php 3 patches
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -400,7 +400,9 @@  discard block
 block discarded – undo
400 400
                 $hits[] = $res;
401 401
             }
402 402
         }
403
-        if (sizeof($hits) > 0) return $hits;
403
+        if (sizeof($hits) > 0) {
404
+          return $hits;
405
+        }
404 406
 
405 407
         // case 2: case-insensitive match on preferred label
406 408
         foreach ($results as $res) {
@@ -408,7 +410,9 @@  discard block
 block discarded – undo
408 410
                 $hits[] = $res;
409 411
             }
410 412
         }
411
-        if (sizeof($hits) > 0) return $hits;
413
+        if (sizeof($hits) > 0) {
414
+          return $hits;
415
+        }
412 416
 
413 417
         if ($lang === null) {
414 418
             // case 1A: exact match on preferred label in any language
@@ -419,7 +423,9 @@  discard block
 block discarded – undo
419 423
                     $hits[] = $res;
420 424
                 }
421 425
             }
422
-            if (sizeof($hits) > 0) return $hits;
426
+            if (sizeof($hits) > 0) {
427
+              return $hits;
428
+            }
423 429
 
424 430
             // case 2A: case-insensitive match on preferred label in any language
425 431
             foreach ($results as $res) {
@@ -429,7 +435,9 @@  discard block
 block discarded – undo
429 435
                     $hits[] = $res;
430 436
                 }
431 437
             }
432
-            if (sizeof($hits) > 0) return $hits;
438
+            if (sizeof($hits) > 0) {
439
+              return $hits;
440
+            }
433 441
         }
434 442
 
435 443
         // case 3: exact match on alternate label
@@ -438,7 +446,9 @@  discard block
 block discarded – undo
438 446
                 $hits[] = $res;
439 447
             }
440 448
         }
441
-        if (sizeof($hits) > 0) return $hits;
449
+        if (sizeof($hits) > 0) {
450
+          return $hits;
451
+        }
442 452
 
443 453
 
444 454
         // case 4: case-insensitive match on alternate label
@@ -447,7 +457,9 @@  discard block
 block discarded – undo
447 457
                 $hits[] = $res;
448 458
             }
449 459
         }
450
-        if (sizeof($hits) > 0) return $hits;
460
+        if (sizeof($hits) > 0) {
461
+          return $hits;
462
+        }
451 463
 
452 464
         return $hits;
453 465
     }
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -575,9 +575,9 @@  discard block
 block discarded – undo
575 575
                 $vocid = $request->getVocab()->getId();
576 576
                 return $this->returnError('404', 'Not Found', "No download source URL known for vocabulary $vocid in language $dataLang");
577 577
             }
578
-		} else {
578
+    } else {
579 579
             header("Location: " . $urls[$format]);
580
-		}
580
+    }
581 581
     }
582 582
 
583 583
     private function returnDataResults($results, $format) {
@@ -1120,9 +1120,9 @@  discard block
 block discarded – undo
1120 1120
         }
1121 1121
         return $this->returnJson(array_merge_recursive($this->context,
1122 1122
                                                         array('@context' => array( '@language' => $request->getLang(),
1123
-                                                                                     'prefLabel' => 'skos:prefLabel',
1124
-                                                                                     'xsd' => 'http://www.w3.org/2001/XMLSchema#',
1125
-                                                                                     'date' => array( '@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime') )
1123
+                                                                                      'prefLabel' => 'skos:prefLabel',
1124
+                                                                                      'xsd' => 'http://www.w3.org/2001/XMLSchema#',
1125
+                                                                                      'date' => array( '@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime') )
1126 1126
                                                         ),
1127 1127
                                                         array('changeList' => $simpleChangeList)));
1128 1128
 
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         // wrap with JSONP callback if requested
26 26
         if (filter_input(INPUT_GET, 'callback', FILTER_SANITIZE_FULL_SPECIAL_CHARS)) {
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
             }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
                 'prefLabel' => 'skos:prefLabel',
233 233
                 'title' => 'dct:title',
234 234
                 '@language' => $request->getLang(),
235
-                '@base' => $this->getBaseHref() . "rest/v1/" . $vocab->getId() . "/",
235
+                '@base' => $this->getBaseHref()."rest/v1/".$vocab->getId()."/",
236 236
             ),
237 237
             'uri' => '',
238 238
             'id' => $vocab->getId(),
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
                 'subTypes' => array('@id' => 'void:class', '@type' => '@id'),
288 288
                 'count' => 'void:entities',
289 289
                 '@language' => $request->getLang(),
290
-                '@base' => $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/",
290
+                '@base' => $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/",
291 291
             ),
292 292
             'uri' => '',
293 293
             'id' => $request->getVocab()->getId(),
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
                 'language' => 'void-ext:language',
370 370
                 'properties' => 'void:propertyPartition',
371 371
                 'labels' => 'void:triples',
372
-                '@base' => $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/",
372
+                '@base' => $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/",
373 373
             ),
374 374
             'uri' => '',
375 375
             'id' => $request->getVocab()->getId(),
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
             $types[] = $type;
411 411
         }
412 412
 
413
-        $base = $request->getVocab() ? $this->getBaseHref() . "rest/v1/" . $request->getVocab()->getId() . "/" : $this->getBaseHref() . "rest/v1/";
413
+        $base = $request->getVocab() ? $this->getBaseHref()."rest/v1/".$request->getVocab()->getId()."/" : $this->getBaseHref()."rest/v1/";
414 414
 
415 415
         $ret = array_merge_recursive($this->context, array(
416 416
             '@context' => array(
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
         if ($lang === null) {
452 452
             // case 1A: exact match on preferred label in any language
453 453
             foreach ($results as $res) {
454
-                if (isset($res['matchedPrefLabel']) && $res['matchedPrefLabel']  == $label) {
454
+                if (isset($res['matchedPrefLabel']) && $res['matchedPrefLabel'] == $label) {
455 455
                     $res['prefLabel'] = $res['matchedPrefLabel'];
456 456
                     unset($res['matchedPrefLabel']);
457 457
                     $hits[] = $res;
@@ -573,19 +573,19 @@  discard block
 block discarded – undo
573 573
 
574 574
         $format = $this->negotiateFormat(array_keys($urls), $request->getServerConstant('HTTP_ACCEPT'), $request->getQueryParam('format'));
575 575
         if (!$format) {
576
-            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: " . implode(' ', array_keys($urls)));
576
+            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: ".implode(' ', array_keys($urls)));
577 577
         }
578 578
         if (is_array($urls[$format])) {
579 579
             $arr = $urls[$format];
580 580
             $dataLang = $request->getLang();
581 581
             if (isset($arr[$dataLang])) {
582
-                header("Location: " . $arr[$dataLang]);
582
+                header("Location: ".$arr[$dataLang]);
583 583
             } else {
584 584
                 $vocid = $request->getVocab()->getId();
585 585
                 return $this->returnError('404', 'Not Found', "No download source URL known for vocabulary $vocid in language $dataLang");
586 586
             }
587 587
 		} else {
588
-            header("Location: " . $urls[$format]);
588
+            header("Location: ".$urls[$format]);
589 589
 		}
590 590
     }
591 591
 
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 
649 649
         $format = $this->negotiateFormat(explode(' ', self::SUPPORTED_FORMATS), $request->getServerConstant('HTTP_ACCEPT'), $request->getQueryParam('format'));
650 650
         if (!$format) {
651
-            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: " . self::SUPPORTED_FORMATS);
651
+            return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: ".self::SUPPORTED_FORMATS);
652 652
         }
653 653
 
654 654
         $vocid = $vocab ? $vocab->getId() : null;
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
                         }
934 934
                     }
935 935
                     // if the main concept scheme was not found, set 'top' to the first 'tops' (sorted alphabetically on the URIs)
936
-                    if (! isset($results[$uri]['top'])) {
936
+                    if (!isset($results[$uri]['top'])) {
937 937
                         $results[$uri]['top'] = $results[$uri]['tops'][0];
938 938
                     }
939 939
                 } else {
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
         $changeList = $request->getVocab()->getChangeList($prop, $request->getLang(), $offset, $limit);
1112 1112
 
1113 1113
         $simpleChangeList = array();
1114
-        foreach($changeList as $conceptInfo) {
1114
+        foreach ($changeList as $conceptInfo) {
1115 1115
             if (array_key_exists('date', $conceptInfo)) {
1116 1116
                 $concept = array(
1117 1117
                     'uri' => $conceptInfo['uri'],
@@ -1127,10 +1127,10 @@  discard block
 block discarded – undo
1127 1127
             }
1128 1128
         }
1129 1129
         return $this->returnJson(array_merge_recursive($this->context,
1130
-                                                        array('@context' => array( '@language' => $request->getLang(),
1130
+                                                        array('@context' => array('@language' => $request->getLang(),
1131 1131
                                                                                      'prefLabel' => 'skos:prefLabel',
1132 1132
                                                                                      'xsd' => 'http://www.w3.org/2001/XMLSchema#',
1133
-                                                                                     'date' => array( '@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime') )
1133
+                                                                                     'date' => array('@id' => 'http://purl.org/dc/terms/date', '@type' => 'http://www.w3.org/2001/XMLSchema#dateTime'))
1134 1134
                                                         ),
1135 1135
                                                         array('changeList' => $simpleChangeList)));
1136 1136
 
Please login to merge, or discard this patch.
model/PluginRegister.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,7 @@
 block discarded – undo
40 40
                     $ret[$name] = array();
41 41
                     if ($raw) {
42 42
                         $ret[$name] = $files[$type];
43
-                    }
44
-                    else {
43
+                    } else {
45 44
                         foreach ($files[$type] as $file) {
46 45
                             array_push($ret[$name], 'plugins/' . $name . '/' . $file);
47 46
                         }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 class PluginRegister {
4 4
     private $requestedPlugins;
5 5
 
6
-    public function __construct($requestedPlugins=array()) {
6
+    public function __construct($requestedPlugins = array()) {
7 7
         $this->requestedPlugins = $requestedPlugins;
8 8
         $this->pluginOrder = array();
9 9
         foreach ($this->requestedPlugins as $index => $value) {
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      * @param boolean $raw interpret $type values as raw text instead of files
46 46
      * @return array
47 47
      */
48
-    private function filterPlugins($type, $raw=false) {
48
+    private function filterPlugins($type, $raw = false) {
49 49
         $plugins = $this->getPlugins();
50 50
         $plugins = $this->sortPlugins($plugins);
51 51
         $ret = array();
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
                     }
59 59
                     else {
60 60
                         foreach ($files[$type] as $file) {
61
-                            array_push($ret[$name], 'plugins/' . $name . '/' . $file);
61
+                            array_push($ret[$name], 'plugins/'.$name.'/'.$file);
62 62
                         }
63 63
                     }
64 64
                 }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
      * @param array $names the plugin name strings (foldernames) in an array
90 90
      * @return array
91 91
      */
92
-    public function getPluginsJS($names=null) {
92
+    public function getPluginsJS($names = null) {
93 93
         if ($names) {
94 94
             $names = array_merge($this->requestedPlugins, $names);
95 95
             return $this->filterPluginsByName('js', $names);
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      * @param array $names the plugin name strings (foldernames) in an array
103 103
      * @return array
104 104
      */
105
-    public function getPluginsCSS($names=null) {
105
+    public function getPluginsCSS($names = null) {
106 106
         if ($names) {
107 107
             $names = array_merge($this->requestedPlugins, $names);
108 108
             return $this->filterPluginsByName('css', $names);
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
      * @param array $names the plugin name strings (foldernames) in an array
116 116
      * @return array
117 117
      */
118
-    public function getPluginsTemplates($names=null) {
118
+    public function getPluginsTemplates($names = null) {
119 119
         if ($names) {
120 120
             $names = array_merge($this->requestedPlugins, $names);
121 121
             return $this->filterPluginsByName('templates', $names);
@@ -128,15 +128,15 @@  discard block
 block discarded – undo
128 128
      * @param array $names the plugin name strings (foldernames) in an array
129 129
      * @return array
130 130
      */
131
-    public function getTemplates($names=null) {
131
+    public function getTemplates($names = null) {
132 132
         $templateStrings = array();
133 133
         $plugins = $this->getPluginsTemplates($names);
134 134
         foreach ($plugins as $folder => $templates) {
135 135
             foreach ($templates as $path) {
136 136
                 if (file_exists($path)) {
137 137
                     $filename = explode('/', $path);
138
-                    $filename = $filename[sizeof($filename)-1];
139
-                    $id = $folder . '-' . substr($filename, 0 , (strrpos($filename, ".")));
138
+                    $filename = $filename[sizeof($filename) - 1];
139
+                    $id = $folder.'-'.substr($filename, 0, (strrpos($filename, ".")));
140 140
                     $templateStrings[$id] = file_get_contents($path);
141 141
                 }
142 142
             }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      * @param array $names the plugin name strings (foldernames) in an array
150 150
      * @return array
151 151
      */
152
-    public function getPluginCallbacks($names=null) {
152
+    public function getPluginCallbacks($names = null) {
153 153
         if ($names) {
154 154
             $names = array_merge($this->requestedPlugins, $names);
155 155
             return $this->filterPluginsByName('callback', $names);
Please login to merge, or discard this patch.
model/Cache.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
     /**
20 20
      * Wraps apc_store() and apcu_store()
21 21
      */
22
-    public function store($key, $value, $ttl=3600) {
22
+    public function store($key, $value, $ttl = 3600) {
23 23
         if (function_exists('apcu_store')) {
24 24
             return apcu_store($key, $value, $ttl);
25 25
         }
Please login to merge, or discard this patch.
model/GlobalConfig.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,10 +109,12 @@
 block discarded – undo
109 109
      */
110 110
     private function initializeNamespaces() {
111 111
         foreach ($this->namespaces as $prefix => $fullUri) {
112
-            if ($prefix != '' && EasyRdf\RdfNamespace::get($prefix) === null) // if not already defined
112
+            if ($prefix != '' && EasyRdf\RdfNamespace::get($prefix) === null) {
113
+              // if not already defined
113 114
             {
114 115
                 EasyRdf\RdfNamespace::set($prefix, $fullUri);
115 116
             }
117
+            }
116 118
         }
117 119
     }
118 120
 
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -30,17 +30,17 @@  discard block
 block discarded – undo
30 30
      */
31 31
     private $configModifiedTime = null;
32 32
 
33
-    public function __construct($config_name='/../config.ttl')
33
+    public function __construct($config_name = '/../config.ttl')
34 34
     {
35 35
         $this->cache = new Cache();
36 36
         try {
37
-            $this->filePath = realpath( dirname(__FILE__) . $config_name );
37
+            $this->filePath = realpath(dirname(__FILE__).$config_name);
38 38
             if (!file_exists($this->filePath)) {
39 39
                 throw new Exception('config.ttl file is missing, please provide one.');
40 40
             }
41 41
             $this->initializeConfig();
42 42
         } catch (Exception $e) {
43
-            echo "Error: " . $e->getMessage();
43
+            echo "Error: ".$e->getMessage();
44 44
             return;
45 45
         }
46 46
     }
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
             // use APC user cache to store parsed config.ttl configuration
75 75
             if ($this->cache->isAvailable() && !is_null($this->configModifiedTime)) {
76 76
                 // @codeCoverageIgnoreStart
77
-                $key = realpath($this->filePath) . ", " . $this->configModifiedTime;
78
-                $nskey = "namespaces of " . $key;
77
+                $key = realpath($this->filePath).", ".$this->configModifiedTime;
78
+                $nskey = "namespaces of ".$key;
79 79
                 $this->graph = $this->cache->fetch($key);
80 80
                 $this->namespaces = $this->cache->fetch($nskey);
81 81
                 if ($this->graph && $this->namespaces) { // found in cache
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
             $this->initializeNamespaces();
94 94
         } catch (Exception $e) {
95
-            echo "Error: " . $e->getMessage();
95
+            echo "Error: ".$e->getMessage();
96 96
         }      
97 97
     }
98 98
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      * @param int inclusion depth (0 for root configuration)
114 114
      * @throws \EasyRdf\Exception
115 115
      */
116
-    private function parseConfig($location, $depth=0) {
116
+    private function parseConfig($location, $depth = 0) {
117 117
         if (str_starts_with($location, "http://") || str_starts_with($location, "https://")) {
118 118
             $ch = curl_init($location);
119 119
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
             $graph = $parser->parseGraph($turtle, $location);
138 138
             $namespaces = $parser->getNamespaces();
139 139
         } catch (Exception $e) {
140
-            throw new Exception("Failed to parse $location: " . $e->getMessage());
140
+            throw new Exception("Failed to parse $location: ".$e->getMessage());
141 141
         }
142 142
 
143 143
         $configResource = $this->configResource($graph, $location);
@@ -148,10 +148,10 @@  discard block
 block discarded – undo
148 148
             $this->resource = $configResource;
149 149
         } else {
150 150
             // Add triples to existing configuration
151
-            foreach($graph->resources() as $resource) {
151
+            foreach ($graph->resources() as $resource) {
152 152
                 $subject = $resource == $configResource ? $this->resource : $resource;
153
-                foreach($graph->properties($resource) as $property) {
154
-                    foreach($resource->all($property) as $value) {
153
+                foreach ($graph->properties($resource) as $property) {
154
+                    foreach ($resource->all($property) as $value) {
155 155
                         $this->graph->add($subject, $property, $value);
156 156
                     }
157 157
                 }
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
         // only include up to four levels
168 168
         if ($depth < 4) {
169 169
             $includes = $this->graph->allResources($this->resource, "skosmos:includeConfig");
170
-            foreach($includes as $location) {
171
-                $this->parseConfig($location->getUri(), $depth+1);
170
+            foreach ($includes as $location) {
171
+                $this->parseConfig($location->getUri(), $depth + 1);
172 172
             }
173 173
         }
174 174
     }
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
     public function getGlobalPlugins()
389 389
     {
390 390
         $globalPlugins = array();
391
-        $globalPluginsResource =  $this->getResource()->getResource("skosmos:globalPlugins");
391
+        $globalPluginsResource = $this->getResource()->getResource("skosmos:globalPlugins");
392 392
         if ($globalPluginsResource) {
393 393
             foreach ($globalPluginsResource as $resource) {
394 394
                 $globalPlugins[] = $resource->getValue();
Please login to merge, or discard this patch.