Passed
Push — Model-integration ( fa1757...6fd2da )
by Stone
02:17
created
Category
Core/JsonException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
  * Class JsonException
10 10
  * @package Core
11 11
  */
12
-class JsonException extends \Exception{
12
+class JsonException extends \Exception {
13 13
 
14 14
     public function __construct(string $message = "", int $code = 0, Throwable $previous = null)
15 15
     {
Please login to merge, or discard this patch.
Core/Error.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             $viewData['showErrors'] = true; //sending the config option down to twig
67 67
             $viewData['classException'] = get_class($exception);
68 68
             $viewData['stackTrace'] = $exception->getTraceAsString();
69
-            $viewData['thrownIn'] = $exception->getFile() . " On line " . $exception->getLine();
69
+            $viewData['thrownIn'] = $exception->getFile()." On line ".$exception->getLine();
70 70
         }
71 71
 
72 72
         $container = new Container();
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
         //Making sure that the twig template renders correctly.
75 75
         try {
76 76
             $twig = $container->getTemplate();
77
-            $twig->display('ErrorPages/' . $code . '.twig', $viewData);
77
+            $twig->display('ErrorPages/'.$code.'.twig', $viewData);
78 78
         } catch (\Exception $e) {
79
-            echo 'Twig Error : ' . $e->getMessage();
79
+            echo 'Twig Error : '.$e->getMessage();
80 80
         }
81 81
 
82 82
 
Please login to merge, or discard this patch.
Core/AjaxController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@
 block discarded – undo
102 102
             500 => '500 Internal Server Error'
103 103
         );
104 104
         // ok, validation error, or failure
105
-        header('Status: ' . $status[$code]);
105
+        header('Status: '.$status[$code]);
106 106
         // return the encoded json
107 107
         return json_encode(array(
108 108
             'status' => $code < 300, // success or not?
Please login to merge, or discard this patch.
Core/Router.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
             $specialNamespace = array_shift($url);
68 68
 
69 69
             //making sure we have a single backslash
70
-            $specialNamespace = rtrim($specialNamespace, '\\') . '\\';
70
+            $specialNamespace = rtrim($specialNamespace, '\\').'\\';
71 71
 
72 72
             //capitalize the special namespace
73 73
             $specialNamespace = $this->convertToStudlyCaps($specialNamespace);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     {
102 102
 
103 103
         $url = $this->container->getRequest()->getData('url');
104
-        if($url){
104
+        if ($url) {
105 105
             //remove right slash
106 106
             $url = rtrim($url, '/');
107 107
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     {
134 134
 
135 135
         //try to create the controller object
136
-        $fullControllerName = $this->currentNamespace . $this->currentController;
136
+        $fullControllerName = $this->currentNamespace.$this->currentController;
137 137
 
138 138
         //make sure the class exists before continuing
139 139
         if (!class_exists($fullControllerName)) {
Please login to merge, or discard this patch.
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_ASSOC
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.
App/Models/Includes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@
 block discarded – undo
22 22
         $data = [];
23 23
         //get the categories from database
24 24
         $categories = $this->getResultSet('categories');
25
-        foreach ( $categories as $category) {
26
-            $data +=[
25
+        foreach ($categories as $category) {
26
+            $data += [
27 27
                 $category['category_name'] => '/category/'.$category['categories_slug']
28 28
             ];
29 29
         }
Please login to merge, or discard this patch.
App/Controllers/Admin/Home.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 
4 4
 
5 5
 class Home extends \Core\Controller {
6
-    public function index(){
6
+    public function index() {
7 7
         $this->view->renderTemplate('Admin/Home');
8 8
     }
9 9
 }
10 10
\ No newline at end of file
Please login to merge, or discard this patch.
Core/Controller.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     public function getView($template)
62 62
     {
63 63
         $twig = $this->container->getTemplate();
64
-        return $twig->render($template . '.twig', $this->data);
64
+        return $twig->render($template.'.twig', $this->data);
65 65
     }
66 66
 
67 67
     /**
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     public function renderView($template): void
76 76
     {
77 77
         $twig = $this->container->getTemplate();
78
-        $twig->display($template . '.twig', $this->data);
78
+        $twig->display($template.'.twig', $this->data);
79 79
     }
80 80
 
81 81
     /**
Please login to merge, or discard this patch.
Core/Dependency/Request.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
     {
60 60
         $host = $_SERVER['HTTP_HOST'];
61 61
         $https = !empty($_SERVER['HTTPS']) ? 'https' : 'http';
62
-        return $https . '://' . $host . '/';
62
+        return $https.'://'.$host.'/';
63 63
     }
64 64
 
65 65
 }
66 66
\ No newline at end of file
Please login to merge, or discard this patch.