Passed
Push — Auth ( b436cf...a80f44 )
by Stone
02:22
created
App/Controllers/Admin/Tag.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
 
90 90
         //checking result and redirecting
91 91
         if ($tagUpdate) {
92
-            $this->alertBox->setAlert("Tag " . $tagName . " updated");
92
+            $this->alertBox->setAlert("Tag ".$tagName." updated");
93 93
             $this->response->redirect("/admin/tag/list/");
94 94
         }
95
-        $this->alertBox->setAlert("Error updating " . $tagName, "error");
95
+        $this->alertBox->setAlert("Error updating ".$tagName, "error");
96 96
         $this->response->redirect("/admin/tag/list/");
97 97
     }
98 98
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         $removedTag = $this->tagModel->delete($tagId);
110 110
 
111 111
         if ($removedTag) {
112
-            $this->alertBox->setAlert("Tag " . $tagName . " deleted");
112
+            $this->alertBox->setAlert("Tag ".$tagName." deleted");
113 113
         }
114 114
 
115 115
         $this->response->redirect("/admin/tag/list/");
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
 
146 146
         //checking result and redirecting
147 147
         if ($tagNew) {
148
-            $this->alertBox->setAlert("Tag " . $tagName . " created");
148
+            $this->alertBox->setAlert("Tag ".$tagName." created");
149 149
             $this->response->redirect("/admin/tag/list/");
150 150
         }
151
-        $this->alertBox->setAlert("Error creating " . $tagName, "error");
151
+        $this->alertBox->setAlert("Error creating ".$tagName, "error");
152 152
         $this->response->redirect("/admin/tag/list/");
153 153
     }
154 154
 }
155 155
\ No newline at end of file
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
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      */
16 16
     public function index()
17 17
     {
18
-        if(!$this->auth->isUser()){
18
+        if (!$this->auth->isUser()) {
19 19
             $this->alertBox->setAlert("You must be connected to access the admin interface", 'warning');
20 20
             $this->container->getResponse()->redirect();
21 21
         }
Please login to merge, or discard this patch.
App/Controllers/Ajax/ImageUpload.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
     private function getFilename(string $folder, string $file): string
44 44
     {
45 45
 
46
-        $fileUrl = $folder . $file;
46
+        $fileUrl = $folder.$file;
47 47
         $docRoot = $this->request->getDocumentRoot();
48
-        $filePath = $docRoot . "/public/" . $fileUrl;
48
+        $filePath = $docRoot."/public/".$fileUrl;
49 49
         if (file_exists($filePath) !== 1) {
50 50
             $fileNum = 0;
51 51
             while (file_exists($filePath)) {
52
-                $fileUrl = $folder . $fileNum . "_" . $file;
53
-                $filePath = $docRoot . "/public/" . $fileUrl;
52
+                $fileUrl = $folder.$fileNum."_".$file;
53
+                $filePath = $docRoot."/public/".$fileUrl;
54 54
                 $fileNum += 1;
55 55
             }
56 56
         }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
             // Respond to the successful upload with JSON.
76 76
             echo json_encode(array('location' => $filetowrite));
77
-        } else {
77
+        }else {
78 78
             // Notify editor that the upload failed
79 79
             echo json_encode(array('error' => 'Upload failed, file might be too big'));
80 80
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
             // Respond to the successful upload with JSON.
110 110
             echo json_encode(array('location' => $filetowrite));
111
-        } else {
111
+        }else {
112 112
             // Notify editor that the upload failed
113 113
             header("HTTP/1.1 500 Server Error");
114 114
         }
Please login to merge, or discard this patch.
App/Controllers/Ajax/postModification.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
         if (!$this->container->getRequest()->isPost()) {
29 29
             throw new \Core\JsonException('Call is not post');
30 30
         }
31
-        $state = (bool)($this->request->getData("state") === 'true');
32
-        $postId = (int)$this->request->getData("postId");
31
+        $state = (bool) ($this->request->getData("state") === 'true');
32
+        $postId = (int) $this->request->getData("postId");
33 33
 
34 34
         $result = array();
35 35
         $result["success"] = $this->postModule->setPublished(!$state, $postId);
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             throw new \Core\JsonException('Call is not post');
50 50
         }
51 51
         $state = ($this->request->getData("state") === 'true');
52
-        $postId = (int)$this->request->getData("postId");
52
+        $postId = (int) $this->request->getData("postId");
53 53
 
54 54
         $result = array();
55 55
         $result["success"] = $this->postModule->setOnFrontPage(!$state, $postId);
Please login to merge, or discard this patch.
App/Controllers/Ajax/PostVerification.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,9 +36,11 @@
 block discarded – undo
36 36
 
37 37
         $data = $postModel->isPostSlugUnique($postSlug);
38 38
 
39
-        if ($data === false) //slug is not unique, but could be from the same post
39
+        if ($data === false) {
40
+            //slug is not unique, but could be from the same post
40 41
         {
41 42
             $slugOfId = $postModel->getPostSlugFromId($postId);
43
+        }
42 44
             if ($slugOfId === $postSlug) {
43 45
                 //it's the same post, return true
44 46
                 $data = true;
Please login to merge, or discard this patch.
Core/Modules/AlertBox.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
         //make sure we have the right type or throw an error
30 30
 
31 31
         if (!in_array($type, $this->allowedTypes)) {
32
-            throw new \Exception("Invalid toastr alert type " . $type);
32
+            throw new \Exception("Invalid toastr alert type ".$type);
33 33
         }
34 34
 
35 35
         $message = htmlspecialchars($message); //avoid any injection
Please login to merge, or discard this patch.