@@ -74,7 +74,7 @@ |
||
| 74 | 74 | public function listen(Array $eventHandlers = array()) |
| 75 | 75 | { |
| 76 | 76 | $event = $eventHandlers; |
| 77 | - $clousure = function(){}; |
|
| 77 | + $clousure = function() {}; |
|
| 78 | 78 | |
| 79 | 79 | if (!array_key_exists('success', $event)) |
| 80 | 80 | $event["success"] = $clousure; |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | break; |
| 95 | 95 | |
| 96 | 96 | case self::LAST_YEAR: |
| 97 | - $year = ((int) date('Y'))- 1; |
|
| 97 | + $year = ((int) date('Y')) - 1; |
|
| 98 | 98 | break; |
| 99 | 99 | |
| 100 | 100 | default: |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $d->setDate($year, (int) $d->format('m'), (int) $d->format('d')); |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - $d->add(new \DateInterval('P'.($day - 1).'D')); |
|
| 145 | + $d->add(new \DateInterval('P' . ($day - 1) . 'D')); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | return $d; |
@@ -126,7 +126,7 @@ |
||
| 126 | 126 | public function getContentsFromUrl($filename) |
| 127 | 127 | { |
| 128 | 128 | $headers = get_headers($url); |
| 129 | - $exists = stripos($headers[0],"200 OK") ? true : false; |
|
| 129 | + $exists = stripos($headers[0], "200 OK") ? true : false; |
|
| 130 | 130 | |
| 131 | 131 | if ($exists) |
| 132 | 132 | return file_get_contents($filename); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | { |
| 121 | 121 | if (is_string($param_values[$i])) |
| 122 | 122 | $bind_types .= 's'; |
| 123 | - else if(is_float($param_values[$i])) |
|
| 123 | + else if (is_float($param_values[$i])) |
|
| 124 | 124 | $bind_types .= 'd'; |
| 125 | 125 | # [POSSIBLE BUG] - To Future revision (What about non-string and non-decimal types ?) |
| 126 | 126 | else |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $this->numFields = $this->dbconn->field_count; |
| 185 | 185 | |
| 186 | 186 | if ($this->transac_mode) |
| 187 | - $this->transac_result = is_null($this->transac_result) ? $this->result: $this->transac_result && $this->result; |
|
| 187 | + $this->transac_result = is_null($this->transac_result) ? $this->result : $this->transac_result && $this->result; |
|
| 188 | 188 | /* |
| 189 | 189 | * Because mysqli_query() returns FALSE on failure, a mysqli_result object for SELECT, SHOW, DESCRIBE or EXPLAIN queries, |
| 190 | 190 | * and TRUE for other successful queries, it should be handled to return only objects or resources. |
@@ -258,12 +258,12 @@ |
||
| 258 | 258 | { |
| 259 | 259 | if (static::HAS_END_TAG) |
| 260 | 260 | { |
| 261 | - $this->startTag = "<" .strtolower(static::NODE_NAME). ">"; |
|
| 262 | - $this->endTag = "</" .strtolower(static::NODE_NAME). ">"; |
|
| 261 | + $this->startTag = "<" . strtolower(static::NODE_NAME) . ">"; |
|
| 262 | + $this->endTag = "</" . strtolower(static::NODE_NAME) . ">"; |
|
| 263 | 263 | } |
| 264 | 264 | else |
| 265 | 265 | { |
| 266 | - $this->startTag = "<" .strtolower(static::NODE_NAME); |
|
| 266 | + $this->startTag = "<" . strtolower(static::NODE_NAME); |
|
| 267 | 267 | $this->endTag = "/>"; |
| 268 | 268 | } |
| 269 | 269 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | ]); |
| 48 | 48 | |
| 49 | 49 | $form->fill([ |
| 50 | - "username" => 'jobs', # wrong because of minlength attr |
|
| 50 | + "username" => 'jobs', # wrong because of minlength attr |
|
| 51 | 51 | "password" => 'jVi7Qp4X', |
| 52 | 52 | "email" => 'j@' # wrong because of type and minlength attr |
| 53 | 53 | ]); |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | ]); |
| 199 | 199 | |
| 200 | 200 | $form->fill([ |
| 201 | - "username" => 'jobs', # wrong because of minlength attr |
|
| 201 | + "username" => 'jobs', # wrong because of minlength attr |
|
| 202 | 202 | ]); |
| 203 | 203 | |
| 204 | 204 | $validator = new FormValidator($form, 'en'); |
@@ -243,12 +243,12 @@ discard block |
||
| 243 | 243 | $form->fill([ |
| 244 | 244 | "product" => [ |
| 245 | 245 | "optical mouse", |
| 246 | - "-", # wrong name |
|
| 246 | + "-", # wrong name |
|
| 247 | 247 | "78" # another wrong name |
| 248 | 248 | ], |
| 249 | 249 | "price" => [ |
| 250 | 250 | 10, |
| 251 | - 0, # wrong price |
|
| 251 | + 0, # wrong price |
|
| 252 | 252 | 0 # another wrong price |
| 253 | 253 | ] |
| 254 | 254 | ]); |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | ]); |
| 306 | 306 | |
| 307 | 307 | $form->fill([ |
| 308 | - "username" => 'steave jobs', # wrong because of minlength attr |
|
| 308 | + "username" => 'steave jobs', # wrong because of minlength attr |
|
| 309 | 309 | "password" => 'jVi7Qp4X', |
| 310 | 310 | "type" => 'moderator' # wrong because moderator is not a valid needle |
| 311 | 311 | ]); |
@@ -304,7 +304,7 @@ |
||
| 304 | 304 | { |
| 305 | 305 | foreach ($validator->getMessages() as $message) |
| 306 | 306 | { |
| 307 | - $this->error($label ."-~-". (count($this->getErrors()) + 1), $message); |
|
| 307 | + $this->error($label . "-~-" . (count($this->getErrors()) + 1), $message); |
|
| 308 | 308 | } |
| 309 | 309 | } |
| 310 | 310 | } |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | { |
| 94 | 94 | $new = array(); |
| 95 | 95 | |
| 96 | - foreach($obj as $key => $val) |
|
| 96 | + foreach ($obj as $key => $val) |
|
| 97 | 97 | { |
| 98 | 98 | $new[$key] = self::objectToArray($val); |
| 99 | 99 | } |
@@ -313,7 +313,7 @@ |
||
| 313 | 313 | if ($_SERVER['REQUEST_METHOD'] != 'JSON') |
| 314 | 314 | throw new \LogicException("Request method is not JSON"); |
| 315 | 315 | |
| 316 | - $input = file_get_contents('php://input'); |
|
| 316 | + $input = file_get_contents('php://input'); |
|
| 317 | 317 | $array = explode("&", $input); |
| 318 | 318 | |
| 319 | 319 | $result = []; |