Passed
Push — Showing-Posts ( 0734d0...3fc5d4 )
by Stone
01:46
created
App/Controllers/Admin/Category.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 use Core\Constant;
9 9
 use Core\Container;
10 10
 
11
-class Category extends AdminController{
11
+class Category extends AdminController {
12 12
 
13 13
     protected $siteConfig;
14 14
     protected $pagination;
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $totalCategories = $this->categoryModel->countCategories();
48 48
         $pagination = $this->pagination->getPagination($page, $totalCategories, $linesPerPage);
49 49
 
50
-        if($linesPerPage !== Constant::LIST_PER_PAGE){
50
+        if ($linesPerPage !== Constant::LIST_PER_PAGE) {
51 51
             $this->data['paginationPostsPerPage'] = $linesPerPage;
52 52
         }
53 53
 
@@ -75,21 +75,21 @@  discard block
 block discarded – undo
75 75
         $categorySlug = $category["categories_slug"];
76 76
 
77 77
         //Sanity check on ID
78
-        if($categoryId == null )
78
+        if ($categoryId == null)
79 79
         {
80 80
             throw new \ErrorException("invalid category ID");
81 81
         }
82 82
 
83
-        $originalCategorySlug = $this->slugModel->getSlugFromId($categoryId, "categories", "idcategories","categories_slug");
83
+        $originalCategorySlug = $this->slugModel->getSlugFromId($categoryId, "categories", "idcategories", "categories_slug");
84 84
 
85 85
         //Error checking
86 86
         $error = false;
87
-        if($categoryName == "")
87
+        if ($categoryName == "")
88 88
         {
89 89
             $error = true;
90 90
             $this->alertBox->setAlert("empty name not allowed", "error");
91 91
         }
92
-        if($categorySlug == "")
92
+        if ($categorySlug == "")
93 93
         {
94 94
             $error = true;
95 95
             $this->alertBox->setAlert("empty slug not allowed", "error");
@@ -107,10 +107,10 @@  discard block
 block discarded – undo
107 107
 
108 108
         //checking result and redirecting
109 109
         if ($categoryUpdate) {
110
-            $this->alertBox->setAlert("Category " . $categoryName . " updated");
110
+            $this->alertBox->setAlert("Category ".$categoryName." updated");
111 111
             $this->container->getResponse()->redirect("/admin/category/list/");
112 112
         }
113
-        $this->alertBox->setAlert("Error updating " . $categoryName, "error");
113
+        $this->alertBox->setAlert("Error updating ".$categoryName, "error");
114 114
         $this->container->getResponse()->redirect("/admin/category/list/");
115 115
     }
116 116
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
         $removedCategory = $this->categoryModel->delete($categoryId);
128 128
 
129
-        if($removedCategory)
129
+        if ($removedCategory)
130 130
         {
131 131
             $this->alertBox->setAlert("Category ".$categoryName." deleted");
132 132
         }
@@ -152,12 +152,12 @@  discard block
 block discarded – undo
152 152
 
153 153
         //Error checking
154 154
         $error = false;
155
-        if($categoryName == "")
155
+        if ($categoryName == "")
156 156
         {
157 157
             $error = true;
158 158
             $this->alertBox->setAlert("empty name not allowed", "error");
159 159
         }
160
-        if($categorySlug == "")
160
+        if ($categorySlug == "")
161 161
         {
162 162
             $error = true;
163 163
             $this->alertBox->setAlert("empty slug not allowed", "error");
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
 
176 176
         //checking result and redirecting
177 177
         if ($categoryNew) {
178
-            $this->alertBox->setAlert("Category " . $categoryName . " created");
178
+            $this->alertBox->setAlert("Category ".$categoryName." created");
179 179
             $this->container->getResponse()->redirect("/admin/category/list/");
180 180
         }
181
-        $this->alertBox->setAlert("Error creating " . $categoryName, "error");
181
+        $this->alertBox->setAlert("Error creating ".$categoryName, "error");
182 182
         $this->container->getResponse()->redirect("/admin/category/list/");
183 183
     }
184 184
 }
185 185
\ No newline at end of file
Please login to merge, or discard this patch.
App/Controllers/Admin/Tag.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 use Core\Constant;
8 8
 use Core\Container;
9 9
 
10
-class Tag extends AdminController{
10
+class Tag extends AdminController {
11 11
 
12 12
     protected $siteConfig;
13 13
     protected $pagination;
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
         $totalCategories = $this->tagModel->countTags();
33 33
         $pagination = $this->pagination->getPagination($page, $totalCategories, $linesPerPage);
34 34
 
35
-        if($linesPerPage !== Constant::LIST_PER_PAGE){
35
+        if ($linesPerPage !== Constant::LIST_PER_PAGE) {
36 36
             $this->data['paginationPostsPerPage'] = $linesPerPage;
37 37
         }
38 38
 
Please login to merge, or discard this patch.