Passed
Push — Showing-Posts ( ca7424...b80001 )
by Stone
02:25
created
App/Models/PostModel.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         string $postSlug
136 136
     )
137 137
     {
138
-        $sql="
138
+        $sql = "
139 139
             UPDATE $this->postsTbl 
140 140
             SET 
141 141
                 title = :title,
@@ -151,15 +151,15 @@  discard block
 block discarded – undo
151 151
               idposts = :postId
152 152
         ;";
153 153
         $this->query($sql);
154
-        $this->bind(":title",$title);
155
-        $this->bind(":postImage",$postImage);
156
-        $this->bind(":idCategory",$idCategory);
157
-        $this->bind(":article",$article);
158
-        $this->bind(":idUser",$idUser);
159
-        $this->bind(":published",$published);
160
-        $this->bind(":onFrontPage",$onFrontPage);
161
-        $this->bind(":postSlug",$postSlug);
162
-        $this->bind(":postId",$postId);
154
+        $this->bind(":title", $title);
155
+        $this->bind(":postImage", $postImage);
156
+        $this->bind(":idCategory", $idCategory);
157
+        $this->bind(":article", $article);
158
+        $this->bind(":idUser", $idUser);
159
+        $this->bind(":published", $published);
160
+        $this->bind(":onFrontPage", $onFrontPage);
161
+        $this->bind(":postSlug", $postSlug);
162
+        $this->bind(":postId", $postId);
163 163
 
164 164
         return $this->execute();
165 165
     }
Please login to merge, or discard this patch.
App/Models/SlugModel.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -21,11 +21,11 @@  discard block
 block discarded – undo
21 21
     {
22 22
 
23 23
         if (!$this->isAlphaNum($table)) {
24
-            throw new \ErrorException("Invalid table name " . $table);
24
+            throw new \ErrorException("Invalid table name ".$table);
25 25
         }
26 26
 
27 27
         if (!$this->isAlphaNum($columnName)) {
28
-            throw new \ErrorException("Invalid Column name " . $columnName);
28
+            throw new \ErrorException("Invalid Column name ".$columnName);
29 29
         }
30 30
 
31 31
         $slugTbl = $this->getTablePrefix($table);
@@ -49,15 +49,15 @@  discard block
 block discarded – undo
49 49
     public function getIdFromSlug(string $slug, string $table, string $columnName, string $idColumn): int
50 50
     {
51 51
         if (!$this->isAlphaNum($table)) {
52
-            throw new \ErrorException("Invalid table name " . $table);
52
+            throw new \ErrorException("Invalid table name ".$table);
53 53
         }
54 54
 
55 55
         if (!$this->isAlphaNum($columnName)) {
56
-            throw new \ErrorException("Invalid Slug Column name " . $columnName);
56
+            throw new \ErrorException("Invalid Slug Column name ".$columnName);
57 57
         }
58 58
 
59 59
         if (!$this->isAlphaNum($idColumn)) {
60
-            throw new \ErrorException("Invalid ID Column name " . $columnName);
60
+            throw new \ErrorException("Invalid ID Column name ".$columnName);
61 61
         }
62 62
 
63 63
         $slugTbl = $this->getTablePrefix($table);
@@ -85,15 +85,15 @@  discard block
 block discarded – undo
85 85
     public function getSlugFromId(int $searchId, string $table, string $columnName, string $slugColumn): string
86 86
     {
87 87
         if (!$this->isAlphaNum($table)) {
88
-            throw new \ErrorException("Invalid table name " . $table);
88
+            throw new \ErrorException("Invalid table name ".$table);
89 89
         }
90 90
 
91 91
         if (!$this->isAlphaNum($columnName)) {
92
-            throw new \ErrorException("Invalid Slug Column name " . $columnName);
92
+            throw new \ErrorException("Invalid Slug Column name ".$columnName);
93 93
         }
94 94
 
95 95
         if (!$this->isAlphaNum($slugColumn)) {
96
-            throw new \ErrorException("Invalid ID Column name " . $columnName);
96
+            throw new \ErrorException("Invalid ID Column name ".$columnName);
97 97
         }
98 98
 
99 99
         $slugTbl = $this->getTablePrefix($table);
Please login to merge, or discard this patch.
App/Controllers/Admin/Post.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
         }
122 122
 
123 123
         if ($postId != null) {
124
-            $this->alertBox->setAlert("Post " . $title . " Created");
125
-            $this->container->getResponse()->redirect("admin/post/modify/" . $postSlug);
124
+            $this->alertBox->setAlert("Post ".$title." Created");
125
+            $this->container->getResponse()->redirect("admin/post/modify/".$postSlug);
126 126
         }
127
-        $this->alertBox->setAlert("Error creating " . $title, "error");
127
+        $this->alertBox->setAlert("Error creating ".$title, "error");
128 128
         $this->container->getResponse()->redirect("admin/post/new");
129 129
 
130 130
     }
@@ -204,11 +204,11 @@  discard block
 block discarded – undo
204 204
         }
205 205
 
206 206
         if ($postUpdate) {
207
-            $this->alertBox->setAlert("Post " . $title . " Updated");
208
-            $this->container->getResponse()->redirect("admin/post/modify/" . $postSlug);
207
+            $this->alertBox->setAlert("Post ".$title." Updated");
208
+            $this->container->getResponse()->redirect("admin/post/modify/".$postSlug);
209 209
         }
210
-        $this->alertBox->setAlert("Error updating " . $title, "error");
211
-        $this->container->getResponse()->redirect("admin/post/modify/" . $originalPostSlug);
210
+        $this->alertBox->setAlert("Error updating ".$title, "error");
211
+        $this->container->getResponse()->redirect("admin/post/modify/".$originalPostSlug);
212 212
 
213 213
     }
214 214
 }
215 215
\ No newline at end of file
Please login to merge, or discard this patch.