Passed
Push — issue1627-initialize-model-glo... ( 92e5f2...6ea56d )
by Osma
03:51
created
src/model/GlobalConfig.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
      */
31 31
     private $configModifiedTime = null;
32 32
 
33
-    public function __construct(Model $model, $config_name='../../config.ttl')
33
+    public function __construct(Model $model, $config_name = '../../config.ttl')
34 34
     {
35 35
         $this->cache = new Cache();
36
-        $this->filePath = realpath(dirname(__FILE__) . "/" . $config_name);
36
+        $this->filePath = realpath(dirname(__FILE__)."/".$config_name);
37 37
         if (!file_exists($this->filePath)) {
38 38
             throw new Exception('config.ttl file is missing, please provide one.');
39 39
         }
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
         // use APC user cache to store parsed config.ttl configuration
70 70
         if ($this->cache->isAvailable() && !is_null($this->configModifiedTime)) {
71 71
             // @codeCoverageIgnoreStart
72
-            $key = realpath($this->filePath) . ", " . $this->configModifiedTime;
73
-            $nskey = "namespaces of " . $key;
72
+            $key = realpath($this->filePath).", ".$this->configModifiedTime;
73
+            $nskey = "namespaces of ".$key;
74 74
             $this->graph = $this->cache->fetch($key);
75 75
             $this->namespaces = $this->cache->fetch($nskey);
76 76
             if ($this->graph === false || $this->namespaces === false) { // was not found in cache
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
     public function getGlobalPlugins()
320 320
     {
321 321
         $globalPlugins = array();
322
-        $globalPluginsResource =  $this->getResource()->getResource("skosmos:globalPlugins");
322
+        $globalPluginsResource = $this->getResource()->getResource("skosmos:globalPlugins");
323 323
         if ($globalPluginsResource) {
324 324
             foreach ($globalPluginsResource as $resource) {
325 325
                 $globalPlugins[] = $resource->getValue();
Please login to merge, or discard this patch.
src/index.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
     }
10 10
     require_once '../vendor/autoload.php';
11 11
 } catch (Exception $e) {
12
-    echo "Error: " . $e->getMessage();
12
+    echo "Error: ".$e->getMessage();
13 13
     return;
14 14
 }
15 15
 
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     $model = new Model();
18 18
 } catch (Exception $e) {
19 19
     header("HTTP/1.1 500 Internal Server Error");
20
-    echo "Error: " . $e->getMessage();
20
+    echo "Error: ".$e->getMessage();
21 21
     exit(1);
22 22
 }
23 23
 
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     // if language code missing, redirect to guessed language
34 34
     // in any case, redirect to <lang>/
35 35
     $lang = sizeof($parts) == 2 && $parts[1] !== '' ? $parts[1] : $controller->guessLanguage($request);
36
-    header("Location: " . $lang . "/");
36
+    header("Location: ".$lang."/");
37 37
 } else {
38 38
     if (array_key_exists($parts[1], $model->getConfig()->getLanguages())) { // global pages
39 39
         $request->setLang($parts[1]);
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
         }
64 64
         if (sizeof($parts) == 3) { // language code missing
65 65
             $lang = $controller->guessLanguage($request);
66
-            $newurl = $controller->getBaseHref() . $vocab . "/" . $lang . "/";
67
-            header("Location: " . $newurl);
66
+            $newurl = $controller->getBaseHref().$vocab."/".$lang."/";
67
+            header("Location: ".$newurl);
68 68
         } else {
69 69
             if (array_key_exists($parts[2], $model->getConfig()->getLanguages())) {
70 70
                 $lang = $parts[2];
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
                 }
106 106
             } else { // language code missing, redirect to some language version
107 107
                 $lang = $controller->guessLanguage($request, $vocab);
108
-                $newurl = $controller->getBaseHref() . $vocab . "/" . $lang . "/" . implode('/', array_slice($parts, 2));
108
+                $newurl = $controller->getBaseHref().$vocab."/".$lang."/".implode('/', array_slice($parts, 2));
109 109
                 $qs = $request->getServerConstant('QUERY_STRING');
110 110
                 if ($qs) {
111
-                    $newurl .= "?" . $qs;
111
+                    $newurl .= "?".$qs;
112 112
                 }
113 113
                 header("Location: $newurl");
114 114
             }
Please login to merge, or discard this patch.