Completed
Branch master (faa857)
by refat
04:32
created
Core/System/Model.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,7 +66,9 @@  discard block
 block discarded – undo
66 66
        
67 67
         $exists = $this->app->file->exists($file);
68 68
      
69
-        if (! $exists) return $join . ' Not Found';
69
+        if (! $exists) {
70
+            return $join . ' Not Found';
71
+        }
70 72
         
71 73
         $trace = debug_backtrace();
72 74
 
@@ -85,7 +87,9 @@  discard block
 block discarded – undo
85 87
        
86 88
         $exists = $this->app->file->exists($file);
87 89
      
88
-        if (! $exists) return $join . ' Not Found';
90
+        if (! $exists) {
91
+            return $join . ' Not Found';
92
+        }
89 93
         
90 94
         $trace = debug_backtrace();
91 95
 
@@ -104,7 +108,9 @@  discard block
 block discarded – undo
104 108
        
105 109
         $exists = $this->app->file->exists($file);
106 110
      
107
-        if (! $exists) return $join . ' Not Found';
111
+        if (! $exists) {
112
+            return $join . ' Not Found';
113
+        }
108 114
 
109 115
         $trace = debug_backtrace();
110 116
 
Please login to merge, or discard this patch.
Core/System/Database.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -95,9 +95,13 @@  discard block
 block discarded – undo
95 95
 
96 96
     public function join($join, $localId = null, $forginId = null)
97 97
     {
98
-        if (! $localId)  $localId =  trim($join, 's' ). '_id';
98
+        if (! $localId) {
99
+            $localId =  trim($join, 's' ). '_id';
100
+        }
99 101
   
100
-        if (! $forginId) $forginId =  'id';
102
+        if (! $forginId) {
103
+            $forginId =  'id';
104
+        }
101 105
 
102 106
         $sql = $join . ' ON ' . $this->table . '.' . $localId . ' = ' . $join . '.' . $forginId;
103 107
 
@@ -110,7 +114,9 @@  discard block
 block discarded – undo
110 114
     {
111 115
         $sql = array_shift($bindings);
112 116
 
113
-        if (is_array($bindings[0])) $bindings = $bindings[0];
117
+        if (is_array($bindings[0])) {
118
+            $bindings = $bindings[0];
119
+        }
114 120
         
115 121
         $this->addToBindings($bindings);
116 122
 
Please login to merge, or discard this patch.
Core/System/Http/Request.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,9 @@  discard block
 block discarded – undo
27 27
 
28 28
         $requestUri = $this->server('REQUEST_URI');
29 29
 
30
-        if (strpos($requestUri, '?')) list($requestUri, $queryString) = explode('?', $requestUri);
30
+        if (strpos($requestUri, '?')) {
31
+            list($requestUri, $queryString) = explode('?', $requestUri);
32
+        }
31 33
       
32 34
         if (! in_array($script, ['/', '\\'])) {
33 35
           
@@ -37,7 +39,9 @@  discard block
 block discarded – undo
37 39
             $this->url = $requestUri;
38 40
         }
39 41
 
40
-        if ($this->url !== '/') $this->url = rtrim($this->url, '/');
42
+        if ($this->url !== '/') {
43
+            $this->url = rtrim($this->url, '/');
44
+        }
41 45
         
42 46
         $isSecure = false;
43 47
 
@@ -45,8 +49,7 @@  discard block
 block discarded – undo
45 49
             
46 50
             $isSecure = true;
47 51
             
48
-        }
49
-        elseif (! empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || ! empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') {
52
+        } elseif (! empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || ! empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') {
50 53
             $isSecure = true;
51 54
         }
52 55
         
@@ -101,7 +104,9 @@  discard block
 block discarded – undo
101 104
     
102 105
     public function file($input)
103 106
     {
104
-        if (isset($this->files[$input])) return $this->files[$input];
107
+        if (isset($this->files[$input])) {
108
+            return $this->files[$input];
109
+        }
105 110
         
106 111
         $upoadedFile = new UploadeFile($this->app, $input);
107 112
         
Please login to merge, or discard this patch.
Core/System/Http/UploadeFile.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,13 +35,17 @@  discard block
 block discarded – undo
35 35
 
36 36
     private function getFileInfo($input)
37 37
     {
38
-        if (empty($_FILES[$input])) return;
38
+        if (empty($_FILES[$input])) {
39
+            return;
40
+        }
39 41
 
40 42
         $file = $_FILES[$input];
41 43
 
42 44
         $this->error = $file['error'];
43 45
         
44
-        if ($this->error != UPLOAD_ERR_OK) return;
46
+        if ($this->error != UPLOAD_ERR_OK) {
47
+            return;
48
+        }
45 49
 
46 50
         $this->file = $file;
47 51
       
@@ -106,7 +110,9 @@  discard block
 block discarded – undo
106 110
 
107 111
         $newName .= '.' . $this->extension;
108 112
 
109
-        if (! is_dir($target)) mkdir($target, 0777, true);
113
+        if (! is_dir($target)) {
114
+            mkdir($target, 0777, true);
115
+        }
110 116
 
111 117
         $filePath = $target . $newName;
112 118
        
Please login to merge, or discard this patch.
Core/System/Application.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,9 @@
 block discarded – undo
59 59
 
60 60
         $this->file->call($this->file->to('config/constant.php'));
61 61
         
62
-        foreach (glob("routes/*.php") AS $route) $this->file->call($this->file->to($route));
62
+        foreach (glob("routes/*.php") AS $route) {
63
+            $this->file->call($this->file->to($route));
64
+        }
63 65
 
64 66
         $output = $this->route->getProperRoute();
65 67
         
Please login to merge, or discard this patch.
Core/System/Validation.php 1 patch
Braces   +18 added lines, -6 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
 
@@ -148,8 +156,12 @@  discard block
 block discarded – undo
148 156
         $id = null;
149 157
         $userId = null;
150 158
 
151
-        if (count($data) == 2) list($table, $column) = $data;
152
-        if (count($data) == 4) list($table, $column, $id, $userId) = $data;
159
+        if (count($data) == 2) {
160
+            list($table, $column) = $data;
161
+        }
162
+        if (count($data) == 4) {
163
+            list($table, $column, $id, $userId) = $data;
164
+        }
153 165
 
154 166
         $sql = $userId ? $column . ' = ? AND ' . $id . ' != ? ' : $column . ' = ?';
155 167
 
Please login to merge, or discard this patch.
Core/System/Url.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
 
24 24
     public function redirectTo($path, $num = 0)
25 25
     {
26
-        if ($path == 'error') $this->app->session->set('error', true);
26
+        if ($path == 'error') {
27
+            $this->app->session->set('error', true);
28
+        }
27 29
         
28 30
         header('Refresh: ' . $num . '; URL=' . $this->link($path));
29 31
         exit;
Please login to merge, or discard this patch.
Core/System/Route.php 1 patch
Braces   +21 added lines, -7 removed lines patch added patch discarded remove patch
@@ -39,7 +39,9 @@  discard block
 block discarded – undo
39 39
             }
40 40
         }
41 41
 
42
-        if ($this->basController) $action = $this->basController . '/' . $action;
42
+        if ($this->basController) {
43
+            $action = $this->basController . '/' . $action;
44
+        }
43 45
 
44 46
         if ($this->groupMiddleware) {
45 47
 
@@ -75,7 +77,9 @@  discard block
 block discarded – undo
75 77
         $middlewareFrom = array_shift($groupOptions['middleware']);
76 78
         $middleware = $groupOptions['middleware'];
77 79
 
78
-        if ($this->app->request->url() !== $prefix) return $this;
80
+        if ($this->app->request->url() !== $prefix) {
81
+            return $this;
82
+        }
79 83
 
80 84
         $this->prefix = $prefix;
81 85
         $this->basController = $controller;
@@ -137,14 +141,18 @@  discard block
 block discarded – undo
137 141
 
138 142
                             $output = $this->middleware($middleware);
139 143
 
140
-                            if ($output != '') break;
144
+                            if ($output != '') {
145
+                                break;
146
+                            }
141 147
                         }
142 148
 
143 149
                     } else {
144 150
 
145 151
                         $output = $this->middleware($route['middleware']);
146 152
 
147
-                        if ($output != '') break;
153
+                        if ($output != '') {
154
+                            break;
155
+                        }
148 156
                     }
149 157
                 }
150 158
 
@@ -180,7 +188,9 @@  discard block
 block discarded – undo
180 188
     {
181 189
         $methods = ['GET', 'POST'];
182 190
 
183
-        if (($method == 'both') && in_array($this->app->request->method(), $methods)) return true;
191
+        if (($method == 'both') && in_array($this->app->request->method(), $methods)) {
192
+            return true;
193
+        }
184 194
 
185 195
         if (is_array($method)) {
186 196
 
@@ -190,7 +200,9 @@  discard block
 block discarded – undo
190 200
 
191 201
             } else if (count($method) == 2) {
192 202
 
193
-                if (in_array($method[0], $methods) && in_array($method[1], $methods)) return true;
203
+                if (in_array($method[0], $methods) && in_array($method[1], $methods)) {
204
+                    return true;
205
+                }
194 206
 
195 207
             } else {
196 208
 
@@ -233,7 +245,9 @@  discard block
 block discarded – undo
233 245
 
234 246
         $output = $middlewareObject->handle($this->app, static::NEXT);
235 247
 
236
-        if ($output && $output === static::NEXT) $output = '';
248
+        if ($output && $output === static::NEXT) {
249
+            $output = '';
250
+        }
237 251
 
238 252
         return $output;
239 253
     }
Please login to merge, or discard this patch.
App/Middleware/Admin/AuthenticateMiddleware.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,11 +22,15 @@
 block discarded – undo
22 22
 
23 23
         if ($login->isLogged()) {
24 24
             
25
-            if (in_array($request, $pagesWhenLogout)) $app->url->redirectTo('/');
25
+            if (in_array($request, $pagesWhenLogout)) {
26
+                $app->url->redirectTo('/');
27
+            }
26 28
 
27 29
         } else {
28 30
 
29
-            if (! in_array($request, $pagesWhenLogout)) $app->url->redirectTo('/');
31
+            if (! in_array($request, $pagesWhenLogout)) {
32
+                $app->url->redirectTo('/');
33
+            }
30 34
         }
31 35
 
32 36
         return $next;
Please login to merge, or discard this patch.