@@ -21,11 +21,11 @@ discard block |
||
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 |
||
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); |
@@ -92,7 +92,7 @@ |
||
92 | 92 | $trimed .= $string[$wordCounter]; |
93 | 93 | if ($wordCounter < $count - 1) { |
94 | 94 | $trimed .= " "; |
95 | - } else { |
|
95 | + }else { |
|
96 | 96 | $trimed .= "..."; |
97 | 97 | } |
98 | 98 | } |
@@ -85,11 +85,11 @@ |
||
85 | 85 | |
86 | 86 | $postId = $postModel->newPost($title, $postImage, $idCategory, $article, $idUser, $published, $onFrontpage, $postSlug); |
87 | 87 | |
88 | - echo "<p>new post ID : " . $postId . "</p>"; |
|
88 | + echo "<p>new post ID : ".$postId."</p>"; |
|
89 | 89 | |
90 | - if(isset($posts["tags"])){ |
|
90 | + if (isset($posts["tags"])) { |
|
91 | 91 | foreach ($posts["tags"] as $tag) { |
92 | - if(isset($tag["id"])){ |
|
92 | + if (isset($tag["id"])) { |
|
93 | 93 | $tagModel->addTagToPost($postId, $tag["id"]); |
94 | 94 | continue; |
95 | 95 | } |