Passed
Push — Accessing-and-setting-the-site... ( 48e404...4d683f )
by Stone
01:43
created
Core/Container.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
         $twigOptions = [];
48 48
         if (!Config::DEV_ENVIRONMENT) {
49 49
             $twigOptions = [
50
-                'cache' => dirname(__DIR__) . '/Cache'
50
+                'cache' => dirname(__DIR__).'/Cache'
51 51
             ];
52 52
         }
53
-        $loader = new \Twig_Loader_Filesystem(dirname(__DIR__) . '/App/Views');
53
+        $loader = new \Twig_Loader_Filesystem(dirname(__DIR__).'/App/Views');
54 54
         $twig = new \Twig_Environment($loader, $twigOptions);
55 55
 
56 56
         return $twig;
@@ -65,13 +65,13 @@  discard block
 block discarded – undo
65 65
         if ($this->dbh) {
66 66
             return $this->dbh;
67 67
         }
68
-        $dsn = "mysql:host=" . Config::DB_HOST . ";dbname=" . Config::DB_NAME . ";charset=utf8"; //Creating the Data Source name
68
+        $dsn = "mysql:host=".Config::DB_HOST.";dbname=".Config::DB_NAME.";charset=utf8"; //Creating the Data Source name
69 69
         $opt = [
70 70
             PDO::ATTR_PERSISTENT => true,
71 71
             PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
72 72
             PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ
73 73
         ];
74
-        $this->dbh = new PDO($dsn, Config::DB_USER, Config::DB_PASSWORD, $opt);;
74
+        $this->dbh = new PDO($dsn, Config::DB_USER, Config::DB_PASSWORD, $opt); ;
75 75
         return $this->dbh;
76 76
     }
77 77
 
Please login to merge, or discard this patch.
Core/AdminController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@
 block discarded – undo
24 24
 
25 25
     }
26 26
 
27
-    protected function onlyAdmin(){
28
-        if(!$this->auth->isAdmin()){
27
+    protected function onlyAdmin() {
28
+        if (!$this->auth->isAdmin()) {
29 29
             $this->alertBox->setAlert("Only admins can access this", 'error');
30 30
             $this->container->getResponse()->redirect('/admin');
31 31
         }
Please login to merge, or discard this patch.
Core/Dependency/Response.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
             default:
24 24
                 $headerType = 'text/html';
25 25
         }
26
-        $contentType = 'Content-Type: ' . $headerType;
26
+        $contentType = 'Content-Type: '.$headerType;
27 27
 
28 28
         header($contentType);
29 29
     }
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
             }
42 42
         }
43 43
 
44
-        header("location: /" . $url);
44
+        header("location: /".$url);
45 45
         exit(); //after redirect do not execute anything else from the function
46 46
     }
47 47
 }
48 48
\ No newline at end of file
Please login to merge, or discard this patch.
Core/Controller.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -87,45 +87,45 @@  discard block
 block discarded – undo
87 87
         $childClassNamespace = new \ReflectionClass(get_class($this));
88 88
         $childClassNamespace = $childClassNamespace->getNamespaceName();
89 89
         //check in classNameSpace, make sure we are not already in App or core
90
-        if (class_exists($childClassNamespace . '\\Modules\\' . $loadModule)) {
91
-            if($childClassNamespace !== 'App\\Modules\\' || $childClassNamespace !== 'Core\\Modules\\'){
92
-                $loadModuleObj = $childClassNamespace . '\\' . $loadModule;
90
+        if (class_exists($childClassNamespace.'\\Modules\\'.$loadModule)) {
91
+            if ($childClassNamespace !== 'App\\Modules\\' || $childClassNamespace !== 'Core\\Modules\\') {
92
+                $loadModuleObj = $childClassNamespace.'\\'.$loadModule;
93 93
                 $found = true;
94 94
             }
95 95
         }
96 96
         //check in app
97
-        if (class_exists('App\\Modules\\' . $loadModule)) {
98
-            if($found && Config::DEV_ENVIRONMENT){
97
+        if (class_exists('App\\Modules\\'.$loadModule)) {
98
+            if ($found && Config::DEV_ENVIRONMENT) {
99 99
                 $this->alertBox->setAlert($loadModule.' already defined in namespace', 'error');
100 100
             }
101
-            if(!$found){
102
-                $loadModuleObj = 'App\\Modules\\' . $loadModule;
101
+            if (!$found) {
102
+                $loadModuleObj = 'App\\Modules\\'.$loadModule;
103 103
                 $found = true;
104 104
             }
105 105
         }
106 106
         //check in core, send error popup if overcharged
107
-        if (class_exists('Core\\Modules\\' . $loadModule)) {
108
-            if($found && Config::DEV_ENVIRONMENT){
107
+        if (class_exists('Core\\Modules\\'.$loadModule)) {
108
+            if ($found && Config::DEV_ENVIRONMENT) {
109 109
                 $this->alertBox->setAlert($loadModule.' already defined in app', 'error');
110 110
             }
111
-            if(!$found){
112
-                $loadModuleObj = 'Core\\Modules\\' . $loadModule;
111
+            if (!$found) {
112
+                $loadModuleObj = 'Core\\Modules\\'.$loadModule;
113 113
                 $found = true;
114 114
             }
115 115
         }
116
-        if(!$found || $loadModuleObj ==='') {
117
-            throw new \ErrorException('module ' . $loadModule . ' does not exist or not loaded');
116
+        if (!$found || $loadModuleObj === '') {
117
+            throw new \ErrorException('module '.$loadModule.' does not exist or not loaded');
118 118
         }
119 119
 
120 120
         //Modules must be children of the Module template
121 121
         if (!is_subclass_of($loadModuleObj, 'Core\Modules\Module')) {
122
-            throw new \ErrorException('Module ' . $loadModuleName . ' must be a sub class of module');
122
+            throw new \ErrorException('Module '.$loadModuleName.' must be a sub class of module');
123 123
         }
124 124
 
125 125
         $loadedModule = new $loadModuleObj($this->container);
126 126
         //we are not allowed to create public modules, they must be a placeholder ready
127 127
         if (!property_exists($this, $loadModuleName)) {
128
-            throw new \ErrorException('the protected or private variable of ' . $loadModuleName . ' is not present');
128
+            throw new \ErrorException('the protected or private variable of '.$loadModuleName.' is not present');
129 129
         }
130 130
         $this->$loadModuleName = $loadedModule;
131 131
     }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     public function getView($template)
152 152
     {
153 153
         $twig = $this->container->getTemplate();
154
-        return $twig->render($template . '.twig', $this->data);
154
+        return $twig->render($template.'.twig', $this->data);
155 155
     }
156 156
 
157 157
     /**
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
             $this->devHelper();
173 173
         }
174 174
         $twig = $this->container->getTemplate();
175
-        $twig->display($template . '.twig', $this->data);
175
+        $twig->display($template.'.twig', $this->data);
176 176
     }
177 177
 
178 178
     protected function devHelper($var = '')
Please login to merge, or discard this patch.