@@ -8,7 +8,9 @@ |
||
8 | 8 | } |
9 | 9 | |
10 | 10 | public function validate($value){ |
11 | - if(is_null($value) && (!$this->null)) return false; |
|
11 | + if(is_null($value) && (!$this->null)) { |
|
12 | + return false; |
|
13 | + } |
|
12 | 14 | return true; |
13 | 15 | } |
14 | 16 | } |
15 | 17 | \ No newline at end of file |
@@ -15,8 +15,12 @@ |
||
15 | 15 | |
16 | 16 | public function validate($value){ |
17 | 17 | return true; |
18 | - if(is_null($value) && (!$this->nullable)) return false; |
|
19 | - if(strlen($value) > $this->max_length) return false; |
|
18 | + if(is_null($value) && (!$this->nullable)) { |
|
19 | + return false; |
|
20 | + } |
|
21 | + if(strlen($value) > $this->max_length) { |
|
22 | + return false; |
|
23 | + } |
|
20 | 24 | return true; |
21 | 25 | } |
22 | 26 | } |
23 | 27 | \ No newline at end of file |
@@ -12,8 +12,12 @@ |
||
12 | 12 | |
13 | 13 | public function validate($value) |
14 | 14 | { |
15 | - if(is_null($value) && (!$this->null)) return false; |
|
16 | - if(strlen($value) > $this->max_length) return false; |
|
15 | + if(is_null($value) && (!$this->null)) { |
|
16 | + return false; |
|
17 | + } |
|
18 | + if(strlen($value) > $this->max_length) { |
|
19 | + return false; |
|
20 | + } |
|
17 | 21 | return true; |
18 | 22 | } |
19 | 23 | } |
@@ -8,7 +8,9 @@ |
||
8 | 8 | } |
9 | 9 | |
10 | 10 | public function validate($value){ |
11 | - if(is_null($value) && (!$this->null)) return false; |
|
11 | + if(is_null($value) && (!$this->null)) { |
|
12 | + return false; |
|
13 | + } |
|
12 | 14 | return true; |
13 | 15 | } |
14 | 16 | } |
15 | 17 | \ No newline at end of file |
@@ -67,7 +67,8 @@ |
||
67 | 67 | $user = $this->getUserById($user_id); |
68 | 68 | |
69 | 69 | //$hashField = $this->config->hash_field; |
70 | - if (!$user) {// || $user->$hashField !== $_SESSION['session_hash']) { |
|
70 | + if (!$user) { |
|
71 | +// || $user->$hashField !== $_SESSION['session_hash']) { |
|
71 | 72 | return false; |
72 | 73 | } |
73 | 74 |
@@ -17,12 +17,12 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | public function query($query, &...$args) { |
20 | - if(!$this->query_closed){ |
|
20 | + if(!$this->query_closed) { |
|
21 | 21 | $this->query_closed = TRUE; |
22 | 22 | $this->query->close(); |
23 | 23 | } |
24 | 24 | if ($this->query = $this->connection->prepare($query)) { |
25 | - if(count($args)){ |
|
25 | + if(count($args)) { |
|
26 | 26 | $types = implode(array_map(array($this, '_gettype'), $args)); |
27 | 27 | $this->query->bind_param($types, ...$args); |
28 | 28 | } |
@@ -56,7 +56,9 @@ discard block |
||
56 | 56 | } |
57 | 57 | if ($callback != null && is_callable($callback)) { |
58 | 58 | $value = $callback($r);//call_user_func($callback, $r); |
59 | - if ($value == 'break') break; |
|
59 | + if ($value == 'break') { |
|
60 | + break; |
|
61 | + } |
|
60 | 62 | } else { |
61 | 63 | $result[] = $r; |
62 | 64 | } |
@@ -113,9 +115,15 @@ discard block |
||
113 | 115 | } |
114 | 116 | |
115 | 117 | private function _gettype($var) { |
116 | - if (is_string($var)) return 's'; |
|
117 | - if (is_float($var)) return 'd'; |
|
118 | - if (is_int($var)) return 'i'; |
|
118 | + if (is_string($var)) { |
|
119 | + return 's'; |
|
120 | + } |
|
121 | + if (is_float($var)) { |
|
122 | + return 'd'; |
|
123 | + } |
|
124 | + if (is_int($var)) { |
|
125 | + return 'i'; |
|
126 | + } |
|
119 | 127 | return 'b'; |
120 | 128 | } |
121 | 129 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | public function handle($match): FileResponse|NotFoundResponse{ |
53 | - if($match instanceof Match404){ |
|
53 | + if($match instanceof Match404) { |
|
54 | 54 | return new NotFoundResponse(); |
55 | 55 | } |
56 | 56 | return new FileResponse($match->filePath, $match->contentType); |
@@ -60,7 +60,7 @@ |
||
60 | 60 | $middlewareInstance->addMatcher($matcher); |
61 | 61 | $middlewareInstance->setRequest($this->request); |
62 | 62 | $middlewareResult = $middlewareInstance(...$args); |
63 | - if($middlewareResult instanceof HttpResponse){ |
|
63 | + if($middlewareResult instanceof HttpResponse) { |
|
64 | 64 | return $middlewareResult; |
65 | 65 | } |
66 | 66 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | } else { |
22 | 22 | $headers = [ "Location" => $parsedUrl ]; |
23 | 23 | } |
24 | - if(isset($redirect_after)){ |
|
24 | + if(isset($redirect_after)) { |
|
25 | 25 | $_SESSION["redirect_url"] = $redirect_after; |
26 | 26 | |
27 | 27 | } |