Passed
Push — master ( 3058e5...ea781b )
by refat
03:14
created
Core/System/Validation.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
 
25 25
   public function require($input = null, $msg = null)
26 26
   {
27
-    if (! $this->input) $this->input = $input;
27
+    if (!$this->input) $this->input = $input;
28 28
 
29 29
     $value = $this->value($this->input);
30 30
 
31
-    if (! $value) {
31
+    if (!$value) {
32 32
 
33 33
         $msg = $msg ?: 'This input is required';
34 34
 
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
 
40 40
   public function email($input = null, $msg = null)
41 41
   {
42
-    if (! $this->input) $this->input = $input;
42
+    if (!$this->input) $this->input = $input;
43 43
 
44 44
     $value = $this->value($this->input);
45 45
 
46
-    if (! filter_var($value, FILTER_VALIDATE_EMAIL)) {
46
+    if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {
47 47
 
48 48
       $msg = $msg ?: sprintf('%s is not valid Email', ucfirst($this->input));
49 49
 
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
 
55 55
   public function number($input = null, $msg = null)
56 56
   {
57
-    if (! $this->input) $this->input = $input;
57
+    if (!$this->input) $this->input = $input;
58 58
 
59 59
     $value = $this->value($this->input);
60 60
 
61 61
     if ($value) {
62 62
 
63
-      if (! is_numeric($value)) {
63
+      if (!is_numeric($value)) {
64 64
 
65 65
         $msg = $msg ?: 'the Input must be number';
66 66
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
   public function text($input = null, $msg = null)
74 74
   {
75
-    if (! $this->input) $this->input = $input;
75
+    if (!$this->input) $this->input = $input;
76 76
 
77 77
     $value = $this->value($this->input);
78 78
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
     $valueConfirm = $this->value($input);
128 128
 
129
-    if ($valuePassword && $valueConfirm ) {
129
+    if ($valuePassword && $valueConfirm) {
130 130
 
131 131
       if ($valuePassword !== $valueConfirm) {
132 132
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 
199 199
   public function fails()
200 200
   {
201
-    return ! empty($this->errors);
201
+    return !empty($this->errors);
202 202
   }
203 203
 
204 204
   public function getMsgs()
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 
214 214
   public function addError($input, $msg)
215 215
   {
216
-    if (! $this->checkError($input)) {
216
+    if (!$this->checkError($input)) {
217 217
 
218 218
       $this->errors[$input] = $msg;
219 219
     }
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,7 +24,9 @@  discard block
 block discarded – undo
24 24
 
25 25
   public function require($input = null, $msg = null)
26 26
   {
27
-    if (! $this->input) $this->input = $input;
27
+    if (! $this->input) {
28
+      $this->input = $input;
29
+    }
28 30
 
29 31
     $value = $this->value($this->input);
30 32
 
@@ -39,7 +41,9 @@  discard block
 block discarded – undo
39 41
 
40 42
   public function email($input = null, $msg = null)
41 43
   {
42
-    if (! $this->input) $this->input = $input;
44
+    if (! $this->input) {
45
+      $this->input = $input;
46
+    }
43 47
 
44 48
     $value = $this->value($this->input);
45 49
 
@@ -54,7 +58,9 @@  discard block
 block discarded – undo
54 58
 
55 59
   public function number($input = null, $msg = null)
56 60
   {
57
-    if (! $this->input) $this->input = $input;
61
+    if (! $this->input) {
62
+      $this->input = $input;
63
+    }
58 64
 
59 65
     $value = $this->value($this->input);
60 66
 
@@ -72,7 +78,9 @@  discard block
 block discarded – undo
72 78
 
73 79
   public function text($input = null, $msg = null)
74 80
   {
75
-    if (! $this->input) $this->input = $input;
81
+    if (! $this->input) {
82
+      $this->input = $input;
83
+    }
76 84
 
77 85
     $value = $this->value($this->input);
78 86
 
Please login to merge, or discard this patch.
Core/helpers.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 use System\Application;
4 4
 
5
-if (! function_exists('pre')) {
5
+if (!function_exists('pre')) {
6 6
   function pre($var) {
7 7
     echo '<pre>';
8 8
     print_r($var);
@@ -10,28 +10,28 @@  discard block
 block discarded – undo
10 10
   }
11 11
 }
12 12
 
13
-if (! function_exists('array_get')) {
13
+if (!function_exists('array_get')) {
14 14
   function array_get($array, $key, $default = null)
15 15
   {
16 16
     return $array[$key] ?: $default;
17 17
   }
18 18
 }
19 19
 
20
-if (! function_exists('app')) {
20
+if (!function_exists('app')) {
21 21
   function app()
22 22
   {
23 23
     return Application::getInstance();
24 24
   }
25 25
 }
26 26
 
27
-if (! function_exists('_e')) {
27
+if (!function_exists('_e')) {
28 28
   function _e($value)
29 29
   {
30 30
     return htmlspecialchars($value);
31 31
   }
32 32
 }
33 33
 
34
-if (! function_exists('getLastIndex')) {
34
+if (!function_exists('getLastIndex')) {
35 35
   function getLastIndex($index)
36 36
   {
37 37
     $array = explode('\\', $index);
@@ -39,14 +39,14 @@  discard block
 block discarded – undo
39 39
   }
40 40
 }
41 41
 
42
-if (! function_exists('url')) {
42
+if (!function_exists('url')) {
43 43
   function url($path) {
44 44
     $app = Application::getInstance();
45 45
     return $app->url->link($path);
46 46
   }
47 47
 }
48 48
 
49
-if (! function_exists('assets')) {
49
+if (!function_exists('assets')) {
50 50
   function assets($path)
51 51
   {
52 52
     $app = Application::getInstance();
@@ -54,24 +54,24 @@  discard block
 block discarded – undo
54 54
   }
55 55
 }
56 56
 
57
-if (! function_exists('remove_space')) {
57
+if (!function_exists('remove_space')) {
58 58
   function remove_space($str) {
59 59
     return str_replace(' ', '-', $str);
60 60
   }
61 61
 }
62 62
 
63
-if (! function_exists('remove_dash')) {
63
+if (!function_exists('remove_dash')) {
64 64
   function remove_dash($str) {
65 65
     return str_replace('-', ' ', $str);
66 66
   }
67 67
 }
68 68
 
69
-if (! function_exists('clean_name_url')) {
69
+if (!function_exists('clean_name_url')) {
70 70
     function clean_name_url($class = null) {
71 71
 
72 72
       $app = Application::getInstance();
73 73
 
74
-      if (! $class) {
74
+      if (!$class) {
75 75
 
76 76
         $class = debug_backtrace()[1]['class'];
77 77
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
         $class = strtolower($class);
85 85
 
86
-        $class = '/' . $class .  '/';
86
+        $class = '/' . $class . '/';
87 87
       }
88 88
 
89 89
       $url = $app->request->url();
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
   }
97 97
 }
98 98
 
99
-if (! function_exists('text_char_limit')) {
99
+if (!function_exists('text_char_limit')) {
100 100
   function text_char_limit($text, $limit) {
101 101
     if (strlen($text) > $limit) {
102 102
       return substr($text, 0, $limit) . '...';
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
   }
105 105
 }
106 106
 
107
-if (! function_exists('array_equal')) {
107
+if (!function_exists('array_equal')) {
108 108
   function array_equal($a, $b) {
109 109
     return (
110 110
       is_array($a)
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
   }
116 116
 }
117 117
 
118
-if (! function_exists('redirect_after')) {
118
+if (!function_exists('redirect_after')) {
119 119
   function redirect_after($num) {
120 120
     $app = Application::getInstance();
121 121
     $app->url->redirectTo('/', $num);
Please login to merge, or discard this patch.
App/Models/UsersGroupsModel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 
19 19
       $userGroup->pages = [];
20 20
 
21
-      foreach($userGroupInfos as $userGroupInfo) {
21
+      foreach ($userGroupInfos as $userGroupInfo) {
22 22
 
23 23
         $userGroup->pages[] = $userGroupInfo->page;
24 24
       }
Please login to merge, or discard this patch.
App/Models/SettingsModel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
   public function loadAll()
14 14
   {
15
-    foreach($this->all() as $setting) {
15
+    foreach ($this->all() as $setting) {
16 16
 
17 17
       $this->settings[$setting->key] = $setting->value;
18 18
     }
Please login to merge, or discard this patch.
routes/admin/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
   'middleware' => ['admin']
28 28
 ];
29 29
 
30
-$app->route->group($adminOptions, function ($route) {
30
+$app->route->group($adminOptions, function($route) {
31 31
 
32 32
   $route->add('/', 'Home');
33 33
 
Please login to merge, or discard this patch.
Core/System/Application.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
 
90 90
   public function get($key)
91 91
   {
92
-    if (! $this->isSharing($key)) {
92
+    if (!$this->isSharing($key)) {
93 93
 
94 94
       if ($this->isCoreAlias($key)) {
95 95
 
Please login to merge, or discard this patch.
Core/System/Http/Response.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 
35 35
   public function sendHeaders()
36 36
   {
37
-    foreach($this->headers as $header => $value)
37
+    foreach ($this->headers as $header => $value)
38 38
     {
39 39
       header($header . ':' . $value);
40 40
     }
Please login to merge, or discard this patch.
Core/System/Paginatio.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
   {
26 26
     $page = $this->app->request->get('page');
27 27
 
28
-    if (! is_numeric($page) || $page < 1) {
28
+    if (!is_numeric($page) || $page < 1) {
29 29
       $page = 1;
30 30
     }
31 31
 
Please login to merge, or discard this patch.
App/Middleware/Admin/RedirectMiddleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
   public function handle(Application $app, $next)
11 11
   {
12 12
 
13
-    if (! $this->session->has('error') || $this->session->get('error') != true) {
13
+    if (!$this->session->has('error') || $this->session->get('error') != true) {
14 14
 
15 15
       $this->url->redirectTo('/');
16 16
 
Please login to merge, or discard this patch.