Passed
Push — Auth ( 52ac6b...b5e900 )
by Stone
02:27
created
App/Modules/SiteConfig.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         $categories = $categoryModel->getCategories();
51 51
         foreach ($categories as $category) {
52 52
             $data += [
53
-                $category->category_name => '/category/posts/' . $category->categories_slug
53
+                $category->category_name => '/category/posts/'.$category->categories_slug
54 54
             ];
55 55
         }
56 56
         return $data;
@@ -68,11 +68,11 @@  discard block
 block discarded – undo
68 68
         $session = $this->container->getSession();
69 69
 
70 70
         $userToken = $cookie->getCookie("rememberMe");
71
-        if($userToken && $this->isHexa($userToken))
71
+        if ($userToken && $this->isHexa($userToken))
72 72
         {
73 73
             //we have a rememberMe Hash, login
74 74
             $rememberedLogin = $rememberedLoginModel->findByToken($userToken);
75
-            if($rememberedLogin){
75
+            if ($rememberedLogin) {
76 76
                 //we have a hash, login
77 77
                 $user = $userModel->getUserDetailsById($rememberedLogin->users_idusers);
78 78
                 $session->regenerateSessionId(); //regenerate the ID to avoid session ghosting
Please login to merge, or discard this patch.
Core/Traits/StringFunctions.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
         //Searching for the page break tag
85 85
         $breakTagPosition = strpos($text, "<!-- EndOfExcerptBlogOc -->");
86
-        if($breakTagPosition > 0){
86
+        if ($breakTagPosition > 0) {
87 87
             return $this->completeDom(substr($text, 0, $breakTagPosition));
88 88
         }
89 89
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $string = preg_split('/(<img[^>]+\>)|(<p[^>]+\>)|(<span[^>]+\>)|\s/', $text, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
92 92
 
93 93
         //The preg split can return false, probably will never happen but just in case.
94
-        if(!$string)
94
+        if (!$string)
95 95
         {
96 96
             throw new \Error("excerpt generation failed");
97 97
         }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             $trimed .= $string[$wordCounter];
105 105
             if ($wordCounter < $count - 1) {
106 106
                 $trimed .= " ";
107
-            } else {
107
+            }else {
108 108
                 $trimed .= "[...]";
109 109
             }
110 110
         }
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         $result = true;
156 156
         foreach ($strings as $string)
157 157
         {
158
-            if(!$this->isAlphaNum($string))
158
+            if (!$this->isAlphaNum($string))
159 159
             {
160 160
                 $result = false;
161 161
             }
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
      */
171 171
     public function isHexa(string $string)
172 172
     {
173
-        return preg_match("/[\da-f]/",$string);
173
+        return preg_match("/[\da-f]/", $string);
174 174
     }
175 175
 
176 176
     public function isInt($int)
Please login to merge, or discard this patch.
App/Controllers/Ajax/Category.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             $send[$item->name] = $item->value;
41 41
         }
42 42
 
43
-        if(!$this->slug->isSlugValid($send["categories_slug"]))
43
+        if (!$this->slug->isSlugValid($send["categories_slug"]))
44 44
         {
45 45
             $result["success"] = false;
46 46
             $result["errorMessage"] = "Invalid Slug";
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         foreach ($categoryUpdate as $item) {
74 74
             $send[$item->name] = $item->value;
75 75
         }
76
-        if(!$this->slug->isSlugValid($send["categories_slug"]))
76
+        if (!$this->slug->isSlugValid($send["categories_slug"]))
77 77
         {
78 78
             $result["success"] = false;
79 79
             $result["errorMessage"] = "Invalid Slug";
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             die();
82 82
         }
83 83
 
84
-        if(!$this->isInt($send["idcategories"])){
84
+        if (!$this->isInt($send["idcategories"])) {
85 85
             $result["success"] = false;
86 86
             $result["errorMessage"] = "Invalid ID";
87 87
             echo json_encode($result);
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             $send[$item->name] = $item->value;
118 118
         }
119 119
 
120
-        if(!$this->isInt($send["idcategories"])){
120
+        if (!$this->isInt($send["idcategories"])) {
121 121
             $result["success"] = false;
122 122
             $result["errorMessage"] = "Invalid ID";
123 123
             echo json_encode($result);
Please login to merge, or discard this patch.
App/Modules/Slug.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,12 +5,12 @@
 block discarded – undo
5 5
 use Cocur\Slugify\Slugify;
6 6
 use Core\Modules\Module;
7 7
 
8
-class Slug extends Module{
8
+class Slug extends Module {
9 9
     public function isSlugValid(string $slug):bool
10 10
     {
11 11
         $slugify = new Slugify();
12 12
         $validSlug = $slugify->slugify($slug);
13
-        if($slug !== $validSlug)
13
+        if ($slug !== $validSlug)
14 14
         {
15 15
             return false;
16 16
         }
Please login to merge, or discard this patch.