Passed
Push — Showing-Posts ( 232f01...9ab3ae )
by Stone
03:02 queued 42s
created
App/Controllers/Modules/Pagination.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
             throw new \Exception("Pagination Error", "404");
27 27
         }
28 28
         $pageNo = $this->removeFromBeginning($page, "page-");
29
-        if(!filter_var($pageNo, FILTER_VALIDATE_INT)){
29
+        if (!filter_var($pageNo, FILTER_VALIDATE_INT)) {
30 30
             throw new \Exception("Invalid page number");
31 31
         }
32 32
         $offset = ($pageNo - 1) * $rowsPerPage;
Please login to merge, or discard this patch.
App/Controllers/Ajax/ImageUpload.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
     private function getFilename(string $folder, string $file):string
43 43
     {
44 44
 
45
-        $fileUrl = $folder . $file;
45
+        $fileUrl = $folder.$file;
46 46
         $filePath = $_SERVER['DOCUMENT_ROOT']."/public/".$fileUrl;
47
-        if(file_exists($filePath) !== 1)
47
+        if (file_exists($filePath) !== 1)
48 48
         {
49 49
             $fileNum = 0;
50
-            while(file_exists($filePath))
50
+            while (file_exists($filePath))
51 51
             {
52 52
                 $fileUrl = $folder.$fileNum."_".$file;
53 53
                 $filePath = $_SERVER['DOCUMENT_ROOT']."/public/".$fileUrl;
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
             // Respond to the successful upload with JSON.
77 77
             echo json_encode(array('location' => $filetowrite));
78
-        } else {
78
+        }else {
79 79
             // Notify editor that the upload failed
80 80
             echo json_encode(array('error' => 'Upload failed'));
81 81
         }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
             // Respond to the successful upload with JSON.
111 111
             echo json_encode(array('location' => $filetowrite));
112
-        } else {
112
+        }else {
113 113
             // Notify editor that the upload failed
114 114
             header("HTTP/1.1 500 Server Error");
115 115
         }
Please login to merge, or discard this patch.
Core/Traits/StringFunctions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
         //Searching for the page break tag
86 86
         $breakTagPosition = strpos($text, "<!-- EndOfExcerptBlogOc -->");
87
-        if($breakTagPosition > 0){
87
+        if ($breakTagPosition > 0) {
88 88
             return $this->completeDom(substr($text, 0, $breakTagPosition));
89 89
         }
90 90
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             $trimed .= $string[$wordCounter];
99 99
             if ($wordCounter < $count - 1) {
100 100
                 $trimed .= " ";
101
-            } else {
101
+            }else {
102 102
                 $trimed .= "[...]";
103 103
             }
104 104
         }
Please login to merge, or discard this patch.
App/Controllers/Author.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 use Core\Controller;
8 8
 use Core\Container;
9 9
 
10
-class Author extends Controller{
10
+class Author extends Controller {
11 11
 
12 12
 
13 13
     protected $siteConfig;
Please login to merge, or discard this patch.
App/Controllers/Post.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 use Core\Controller;
9 9
 use Core\Container;
10 10
 
11
-class Post extends Controller{
11
+class Post extends Controller {
12 12
 
13 13
     protected $siteConfig;
14 14
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      * @throws \Twig_Error_Runtime
27 27
      * @throws \Twig_Error_Syntax
28 28
      */
29
-    public function viewPost(string $slug){
29
+    public function viewPost(string $slug) {
30 30
 
31 31
         $tagModel = new TagsModel($this->container);
32 32
         $postModel = new PostModel($this->container);
Please login to merge, or discard this patch.
App/Controllers/Tag.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 use Core\Controller;
7 7
 use Core\Container;
8 8
 
9
-class Tag extends Controller{
9
+class Tag extends Controller {
10 10
 
11 11
     protected $siteConfig;
12 12
     protected $pagination;
Please login to merge, or discard this patch.
App/Models/PostModel.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -74,11 +74,11 @@  discard block
 block discarded – undo
74 74
             $sql .= " AND on_front_page = 1";
75 75
         }
76 76
         //if we have a limiting parameter
77
-        if($select != null)
77
+        if ($select != null)
78 78
         {
79 79
             foreach ($select as $col => $val)
80 80
             {
81
-                if(!$this->isAlphaNum($col)){
81
+                if (!$this->isAlphaNum($col)) {
82 82
                     throw new Exception("Invalid column name");
83 83
                 }
84 84
                 $sql .= " AND $col = :$col";
@@ -87,11 +87,11 @@  discard block
 block discarded – undo
87 87
         $sql .= " ORDER BY $this->postsTbl.creation_date DESC";
88 88
         $sql .= " LIMIT :limit OFFSET :offset";
89 89
         $this->query($sql);
90
-        if($select != null)
90
+        if ($select != null)
91 91
         {
92 92
             foreach ($select as $col => $val)
93 93
             {
94
-                $this->bind(":".$col,$val);
94
+                $this->bind(":".$col, $val);
95 95
             }
96 96
         }
97 97
         $this->bind(":limit", $limit);
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
      * @return int number of posts
108 108
      * @throws Exception
109 109
      */
110
-    private function numberPosts(array $select=[]): int
110
+    private function numberPosts(array $select = []): int
111 111
     {
112 112
         $sql = "
113 113
                 SELECT COUNT(*) FROM $this->postsTbl
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         $this->query($sql);
126 126
         if ($select != null) {
127 127
             foreach ($select as $col => $val) {
128
-                $this->bind(":" . $col, $val);
128
+                $this->bind(":".$col, $val);
129 129
             }
130 130
         }
131 131
         $this->execute();
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
      * @return array
197 197
      * @throws \ErrorException
198 198
      */
199
-    public function getPosts(int $offset = 0, array $select=[], int $limit = Constant::POSTS_PER_PAGE): array
199
+    public function getPosts(int $offset = 0, array $select = [], int $limit = Constant::POSTS_PER_PAGE): array
200 200
     {
201 201
         return $this->getAllPublishedPosts($offset, $limit, false, $select);
202 202
     }
Please login to merge, or discard this patch.