| @@ -139,9 +139,9 @@ | ||
| 139 | 139 | $typeByValue = DBField::getType($value); | 
| 140 | 140 |              if ($typeByValue != 's') { | 
| 141 | 141 | if ($type != $typeByValue && !( | 
| 142 | - ($type == 'd' && $typeByValue == 'i') || // We can put integer as double | |
| 142 | + ($type == 'd' && $typeByValue == 'i') || // We can put integer as double | |
| 143 | 143 | ($type == 's' && $typeByValue == 'i') // We can put integer as string | 
| 144 | - ) | |
| 144 | + ) | |
| 145 | 145 |                  ) { | 
| 146 | 146 | throw new DBCoreException( | 
| 147 | 147 |                          "Invalid query parameters types string ('" . $value . | 
| @@ -80,7 +80,7 @@ discard block | ||
| 80 | 80 | */ | 
| 81 | 81 |      public function prepareConditions() { | 
| 82 | 82 |          if (!empty($this->conditions)) { | 
| 83 | - $this->query.= " WHERE "; | |
| 83 | + $this->query .= " WHERE "; | |
| 84 | 84 | $this->sqlPushValues($this->conditions, " AND "); | 
| 85 | 85 | } | 
| 86 | 86 | } | 
| @@ -90,14 +90,14 @@ discard block | ||
| 90 | 90 | */ | 
| 91 | 91 |      public function prepareOrder() { | 
| 92 | 92 |          if (!empty($this->order)) { | 
| 93 | - $this->query.= " ORDER BY"; | |
| 93 | + $this->query .= " ORDER BY"; | |
| 94 | 94 |              if (is_array($this->order)) { | 
| 95 | 95 |                  foreach ($this->order as $fieldName => $ord) { | 
| 96 | - $this->query.= " " . $fieldName . " " . $ord . ","; | |
| 96 | + $this->query .= " ".$fieldName." ".$ord.","; | |
| 97 | 97 | } | 
| 98 | 98 | $this->query = substr($this->query, 0, strlen($this->query) - 1); | 
| 99 | 99 |              } elseif (is_string($this->order)) { | 
| 100 | - $this->query.= " " . $this->order; | |
| 100 | + $this->query .= " ".$this->order; | |
| 101 | 101 | } | 
| 102 | 102 | } | 
| 103 | 103 | } | 
| @@ -112,13 +112,13 @@ discard block | ||
| 112 | 112 | $count = null; | 
| 113 | 113 |          if (!is_null($this->limit)) { | 
| 114 | 114 |              if (Tools::isInteger($this->limit)) { | 
| 115 | - $this->query.= " LIMIT " . $this->limit; | |
| 115 | + $this->query .= " LIMIT ".$this->limit; | |
| 116 | 116 | $count = $this->limit; | 
| 117 | 117 |              } elseif (is_array($this->limit) && count($this->limit) == 2) { | 
| 118 | 118 | $offset = $this->limit[0]; | 
| 119 | 119 | $count = $this->limit[1]; | 
| 120 | 120 |                  if (Tools::isInteger($offset) && Tools::isInteger($count)) { | 
| 121 | - $this->query.= " LIMIT " . $offset . ", " . $count; | |
| 121 | + $this->query .= " LIMIT ".$offset.", ".$count; | |
| 122 | 122 |                  } else { | 
| 123 | 123 |                      throw new DBCoreException("Invalid LIMIT param in select() method."); | 
| 124 | 124 | } | 
| @@ -223,7 +223,7 @@ discard block | ||
| 223 | 223 | |
| 224 | 224 |              if (!in_array($type, ['i', 'd', 's', 'b'])) { | 
| 225 | 225 | throw new DBCoreException( | 
| 226 | - "Invalid query parameters types string (type '" . $type . | |
| 226 | + "Invalid query parameters types string (type '".$type. | |
| 227 | 227 | "' is undefined, only 'i', 'd', 's' and 'b' types are acceptable)" | 
| 228 | 228 | ); | 
| 229 | 229 | } | 
| @@ -236,8 +236,8 @@ discard block | ||
| 236 | 236 | ) | 
| 237 | 237 |                  ) { | 
| 238 | 238 | throw new DBCoreException( | 
| 239 | -                        "Invalid query parameters types string ('" . $value . | |
| 240 | - "' is not '" . $type . "' type but '" . $typeByValue . "' detected)" | |
| 239 | +                        "Invalid query parameters types string ('".$value. | |
| 240 | + "' is not '".$type."' type but '".$typeByValue."' detected)" | |
| 241 | 241 | ); | 
| 242 | 242 | } | 
| 243 | 243 |              } else { // in case if we try send non-string parameters as a string value | 
| @@ -245,21 +245,21 @@ discard block | ||
| 245 | 245 | case 'i': | 
| 246 | 246 |                          if (!(Tools::isNumeric($value) && ((string)(int)$value === $value))) { | 
| 247 | 247 | throw new DBCoreException( | 
| 248 | -                                "Invalid query parameters types string ('" . $value . "' is not '" . $type . ")" | |
| 248 | +                                "Invalid query parameters types string ('".$value."' is not '".$type.")" | |
| 249 | 249 | ); | 
| 250 | 250 | } | 
| 251 | 251 | break; | 
| 252 | 252 | case 'd': | 
| 253 | 253 |                          if (!Tools::isDoubleString($value)) { | 
| 254 | 254 | throw new DBCoreException( | 
| 255 | -                                "Invalid query parameters types string ('" . $value . "' is not '" . $type . ")" | |
| 255 | +                                "Invalid query parameters types string ('".$value."' is not '".$type.")" | |
| 256 | 256 | ); | 
| 257 | 257 | } | 
| 258 | 258 | break; | 
| 259 | 259 | case 'b': | 
| 260 | 260 |                          if (!in_array(strtolower($value), ['true', 'false'])) { | 
| 261 | 261 | throw new DBCoreException( | 
| 262 | -                                "Invalid query parameters types string ('" . $value . "' is not '" . $type . ")" | |
| 262 | +                                "Invalid query parameters types string ('".$value."' is not '".$type.")" | |
| 263 | 263 | ); | 
| 264 | 264 | } | 
| 265 | 265 | break; | 
| @@ -291,7 +291,7 @@ discard block | ||
| 291 | 291 | $chunks = []; | 
| 292 | 292 |          foreach (array_keys($fieldsList) as $fieldName) { | 
| 293 | 293 |              if ($fieldName != $idFieldName) { | 
| 294 | - $chunks[] = "`" . $fieldName . "` = ?"; | |
| 294 | + $chunks[] = "`".$fieldName."` = ?"; | |
| 295 | 295 | } | 
| 296 | 296 | } | 
| 297 | 297 | |
| @@ -310,7 +310,7 @@ discard block | ||
| 310 | 310 | $chunks = []; | 
| 311 | 311 |          foreach ($fieldsList as $fieldName => $fieldValue) { | 
| 312 | 312 |              if ($fieldName != $idFieldName) { | 
| 313 | - $chunks[]= "`" . $fieldName . "` = '" . $fieldValue . "'"; | |
| 313 | + $chunks[] = "`".$fieldName."` = '".$fieldValue."'"; | |
| 314 | 314 | } | 
| 315 | 315 | } | 
| 316 | 316 | |
| @@ -334,11 +334,11 @@ discard block | ||
| 334 | 334 |          foreach ($fieldsList as $fieldName => $fieldValue) { | 
| 335 | 335 |              if ($fieldName != $idFieldName) { | 
| 336 | 336 |                  if (Tools::isDouble($fieldValue)) { | 
| 337 | - $typesString.= "d"; | |
| 337 | + $typesString .= "d"; | |
| 338 | 338 |                  } elseif (Tools::isInteger($fieldValue)) { | 
| 339 | - $typesString.= "i"; | |
| 339 | + $typesString .= "i"; | |
| 340 | 340 |                  } else { | 
| 341 | - $typesString.= "s"; | |
| 341 | + $typesString .= "s"; | |
| 342 | 342 | } | 
| 343 | 343 | } | 
| 344 | 344 | } | 
| @@ -359,7 +359,7 @@ discard block | ||
| 359 | 359 | $type = DBField::castType($type); | 
| 360 | 360 | $typesString = ""; | 
| 361 | 361 |          while ($length > 0) { | 
| 362 | - $typesString.= $type; | |
| 362 | + $typesString .= $type; | |
| 363 | 363 | $length--; | 
| 364 | 364 | } | 
| 365 | 365 | |
| @@ -378,8 +378,8 @@ discard block | ||
| 378 | 378 |          foreach ($values as $fieldName => $fieldValue) { | 
| 379 | 379 |              if (!is_array($fieldValue)) { | 
| 380 | 380 |                  if (!is_null($fieldValue)) { | 
| 381 | - $chunks[] = $fieldName . " = ?"; | |
| 382 | - $this->types.= DBField::getType($fieldValue); | |
| 381 | + $chunks[] = $fieldName." = ?"; | |
| 382 | + $this->types .= DBField::getType($fieldValue); | |
| 383 | 383 | $this->params[] = $fieldValue; | 
| 384 | 384 |                  } else { | 
| 385 | 385 | $chunks[] = $fieldName; | 
| @@ -390,12 +390,12 @@ discard block | ||
| 390 | 390 | |
| 391 | 391 | $chunks[] = $condition; | 
| 392 | 392 |                  foreach ($localParams as $param) { | 
| 393 | - $this->types.= DBField::getType($param); | |
| 393 | + $this->types .= DBField::getType($param); | |
| 394 | 394 | $this->params[] = $param; | 
| 395 | 395 | } | 
| 396 | 396 | } | 
| 397 | 397 | } | 
| 398 | - $this->query.= implode($separator, $chunks); | |
| 398 | + $this->query .= implode($separator, $chunks); | |
| 399 | 399 | } | 
| 400 | 400 | |
| 401 | 401 | } | 
| @@ -149,7 +149,7 @@ | ||
| 149 | 149 | break; | 
| 150 | 150 | } | 
| 151 | 151 | $array = &$array[$key]; | 
| 152 | -                    } elseif(isset($array[$key])) { // last element | |
| 152 | +                    } elseif (isset($array[$key])) { // last element | |
| 153 | 153 | unset($array[$key]); | 
| 154 | 154 | } | 
| 155 | 155 | } | 
| @@ -101,8 +101,8 @@ discard block | ||
| 101 | 101 | */ | 
| 102 | 102 |      public function selectDBObject($debug = false) { | 
| 103 | 103 | $query = "SELECT * FROM " . $this->dbObject->getTableName() | 
| 104 | - . ($this->conditions != "" ? " WHERE " . $this->conditions : "") | |
| 105 | - . " LIMIT 1"; | |
| 104 | + . ($this->conditions != "" ? " WHERE " . $this->conditions : "") | |
| 105 | + . " LIMIT 1"; | |
| 106 | 106 | |
| 107 | 107 |          if (!$debug) { | 
| 108 | 108 | $stmt = DBCore::doSelectQuery($query); | 
| @@ -183,7 +183,7 @@ discard block | ||
| 183 | 183 | */ | 
| 184 | 184 |      public function selectDBObjects($debug = false) { | 
| 185 | 185 | $query = "SELECT" . ($this->unique ? " DISTINCT" : "") | 
| 186 | - . " * FROM " . $this->dbObject->getTableName(); | |
| 186 | + . " * FROM " . $this->dbObject->getTableName(); | |
| 187 | 187 | |
| 188 | 188 |          if ($this->conditions != "") { | 
| 189 | 189 | $query .= " WHERE " . $this->conditions; | 
| @@ -61,8 +61,8 @@ discard block | ||
| 61 | 61 |              $classNamespaceParts = explode("\\", $this->className); | 
| 62 | 62 |              if ($className != $classNamespaceParts[count($classNamespaceParts) - 1]) { | 
| 63 | 63 | throw new DBSelectorException( | 
| 64 | - "Invalid DB object classname '" . $className . "' in method name. " . | |
| 65 | - "Valid classname is '" . $this->className . "'" | |
| 64 | + "Invalid DB object classname '".$className."' in method name. ". | |
| 65 | + "Valid classname is '".$this->className."'" | |
| 66 | 66 | ); | 
| 67 | 67 | } | 
| 68 | 68 | } | 
| @@ -100,8 +100,8 @@ discard block | ||
| 100 | 100 | * @return DBObject | 
| 101 | 101 | */ | 
| 102 | 102 |      public function selectDBObject($debug = false) { | 
| 103 | - $query = "SELECT * FROM " . $this->dbObject->getTableName() | |
| 104 | - . ($this->conditions != "" ? " WHERE " . $this->conditions : "") | |
| 103 | + $query = "SELECT * FROM ".$this->dbObject->getTableName() | |
| 104 | + . ($this->conditions != "" ? " WHERE ".$this->conditions : "") | |
| 105 | 105 | . " LIMIT 1"; | 
| 106 | 106 | |
| 107 | 107 |          if (!$debug) { | 
| @@ -131,14 +131,14 @@ discard block | ||
| 131 | 131 | * @return DBObject | 
| 132 | 132 | */ | 
| 133 | 133 |      public function selectDBObjectByField($fieldName, $fieldValue, $debug = false) { | 
| 134 | - $query = "SELECT * FROM " . $this->dbObject->getTableName() . " WHERE " . $fieldName . " = ?"; | |
| 134 | + $query = "SELECT * FROM ".$this->dbObject->getTableName()." WHERE ".$fieldName." = ?"; | |
| 135 | 135 | |
| 136 | 136 |          if ($this->conditions != "") { | 
| 137 | - $query .= " AND " . $this->conditions; | |
| 137 | + $query .= " AND ".$this->conditions; | |
| 138 | 138 | } | 
| 139 | 139 | |
| 140 | - $query.= $this->getQueryOrderSQL(); | |
| 141 | - $query.= " LIMIT 1"; | |
| 140 | + $query .= $this->getQueryOrderSQL(); | |
| 141 | + $query .= " LIMIT 1"; | |
| 142 | 142 | |
| 143 | 143 | $fieldType = DBField::getType($fieldValue); | 
| 144 | 144 |          if (!$debug) { | 
| @@ -182,15 +182,15 @@ discard block | ||
| 182 | 182 | * @return array<DBObject> | 
| 183 | 183 | */ | 
| 184 | 184 |      public function selectDBObjects($debug = false) { | 
| 185 | - $query = "SELECT" . ($this->unique ? " DISTINCT" : "") | |
| 186 | - . " * FROM " . $this->dbObject->getTableName(); | |
| 185 | + $query = "SELECT".($this->unique ? " DISTINCT" : "") | |
| 186 | + . " * FROM ".$this->dbObject->getTableName(); | |
| 187 | 187 | |
| 188 | 188 |          if ($this->conditions != "") { | 
| 189 | - $query .= " WHERE " . $this->conditions; | |
| 189 | + $query .= " WHERE ".$this->conditions; | |
| 190 | 190 | } | 
| 191 | 191 | |
| 192 | - $query.= $this->getQueryOrderSQL(); | |
| 193 | - $query.= $this->getQueryLimitSQL(); | |
| 192 | + $query .= $this->getQueryOrderSQL(); | |
| 193 | + $query .= $this->getQueryLimitSQL(); | |
| 194 | 194 | |
| 195 | 195 |          if (!$debug) { | 
| 196 | 196 | $stmt = DBCore::doSelectQuery($query); | 
| @@ -219,15 +219,15 @@ discard block | ||
| 219 | 219 | * @return array<DBObject> | 
| 220 | 220 | */ | 
| 221 | 221 |      public function selectDBObjectsByField($fieldName, $fieldValue, $debug = false) { | 
| 222 | - $query = "SELECT * FROM " . $this->dbObject->getTableName(); | |
| 223 | - $query .= " WHERE " . $fieldName . " = ?"; | |
| 222 | + $query = "SELECT * FROM ".$this->dbObject->getTableName(); | |
| 223 | + $query .= " WHERE ".$fieldName." = ?"; | |
| 224 | 224 | |
| 225 | 225 |          if ($this->conditions != "") { | 
| 226 | - $query .= " AND " . $this->conditions; | |
| 226 | + $query .= " AND ".$this->conditions; | |
| 227 | 227 | } | 
| 228 | 228 | |
| 229 | - $query.= $this->getQueryOrderSQL(); | |
| 230 | - $query.= $this->getQueryLimitSQL(); | |
| 229 | + $query .= $this->getQueryOrderSQL(); | |
| 230 | + $query .= $this->getQueryLimitSQL(); | |
| 231 | 231 | |
| 232 | 232 | $fieldType = DBField::getType($fieldValue); | 
| 233 | 233 |          if (!$debug) { | 
| @@ -253,10 +253,10 @@ discard block | ||
| 253 | 253 | * @return int Number of records. | 
| 254 | 254 | */ | 
| 255 | 255 |      public function count() { | 
| 256 | - $query = "SELECT count(*) FROM " . $this->dbObject->getTableName(); | |
| 256 | + $query = "SELECT count(*) FROM ".$this->dbObject->getTableName(); | |
| 257 | 257 | |
| 258 | 258 |          if ($this->conditions != "") { | 
| 259 | - $query .= " WHERE " . $this->conditions; | |
| 259 | + $query .= " WHERE ".$this->conditions; | |
| 260 | 260 | } | 
| 261 | 261 | |
| 262 | 262 | return DBCore::selectSingleValue($query); | 
| @@ -268,10 +268,10 @@ discard block | ||
| 268 | 268 | * @return int Number of records. | 
| 269 | 269 | */ | 
| 270 | 270 |      public function max() { | 
| 271 | - $query = "SELECT max(`" . $this->field . "`) FROM " . $this->dbObject->getTableName(); | |
| 271 | + $query = "SELECT max(`".$this->field."`) FROM ".$this->dbObject->getTableName(); | |
| 272 | 272 | |
| 273 | 273 |          if ($this->conditions != "") { | 
| 274 | - $query .= " WHERE " . $this->conditions; | |
| 274 | + $query .= " WHERE ".$this->conditions; | |
| 275 | 275 | } | 
| 276 | 276 | |
| 277 | 277 | return DBCore::selectSingleValue($query); | 
| @@ -283,10 +283,10 @@ discard block | ||
| 283 | 283 | * @return int Number of records. | 
| 284 | 284 | */ | 
| 285 | 285 |      public function min() { | 
| 286 | - $query = "SELECT min(`" . $this->field . "`) FROM " . $this->dbObject->getTableName(); | |
| 286 | + $query = "SELECT min(`".$this->field."`) FROM ".$this->dbObject->getTableName(); | |
| 287 | 287 | |
| 288 | 288 |          if ($this->conditions != "") { | 
| 289 | - $query .= " WHERE " . $this->conditions; | |
| 289 | + $query .= " WHERE ".$this->conditions; | |
| 290 | 290 | } | 
| 291 | 291 | |
| 292 | 292 | return DBCore::selectSingleValue($query); | 
| @@ -299,10 +299,10 @@ discard block | ||
| 299 | 299 | */ | 
| 300 | 300 |      private function getQueryOrderSQL() { | 
| 301 | 301 |          if ($this->order != "") { | 
| 302 | -            return (" ORDER BY " . $this->order); | |
| 302 | +            return (" ORDER BY ".$this->order); | |
| 303 | 303 | } | 
| 304 | 304 | |
| 305 | -        return (" ORDER BY " . $this->dbObject->getIdFieldName() . " DESC"); | |
| 305 | +        return (" ORDER BY ".$this->dbObject->getIdFieldName()." DESC"); | |
| 306 | 306 | } | 
| 307 | 307 | |
| 308 | 308 | /** | 
| @@ -313,10 +313,10 @@ discard block | ||
| 313 | 313 |      private function getQueryLimitSQL() { | 
| 314 | 314 |          if ($this->count !== "all") { | 
| 315 | 315 |              if ($this->offset > 0) { | 
| 316 | -                return (" LIMIT " . $this->offset . "," . $this->count); | |
| 316 | +                return (" LIMIT ".$this->offset.",".$this->count); | |
| 317 | 317 | } | 
| 318 | 318 | |
| 319 | -            return (" LIMIT " . $this->count); | |
| 319 | +            return (" LIMIT ".$this->count); | |
| 320 | 320 | } | 
| 321 | 321 | |
| 322 | 322 | return ""; | 
| @@ -365,7 +365,7 @@ discard block | ||
| 365 | 365 |          elseif (preg_match("#^selectAll([A-Z]{1}[[:alpha:]]+)s#", $methodName, $matches)) { | 
| 366 | 366 |              $this->validateClassName(preg_replace("#ie$#", "y", $matches[1])); | 
| 367 | 367 | |
| 368 | - $this->order = "`" . $this->dbObject->getIdFieldName() . "` DESC"; | |
| 368 | + $this->order = "`".$this->dbObject->getIdFieldName()."` DESC"; | |
| 369 | 369 |              if (isset($methodParams[0])) { | 
| 370 | 370 | $this->order = (string)$methodParams[0]; | 
| 371 | 371 | } | 
| @@ -412,7 +412,7 @@ discard block | ||
| 412 | 412 |              case ("get"): | 
| 413 | 413 | return $this->getFieldValue($fieldName); | 
| 414 | 414 | default: | 
| 415 | -                throw new DBSelectorException("No method with name '" . $methodName . "'"); | |
| 415 | +                throw new DBSelectorException("No method with name '".$methodName."'"); | |
| 416 | 416 | } | 
| 417 | 417 | } | 
| 418 | 418 | } | 
| @@ -98,7 +98,8 @@ discard block | ||
| 98 | 98 | /** | 
| 99 | 99 | * Delete message from POP server. | 
| 100 | 100 | * | 
| 101 | - * @return int $messageId Id of the message. | |
| 101 | + * @param integer $messageId | |
| 102 | + * @return string $messageId Id of the message. | |
| 102 | 103 | * | 
| 103 | 104 | * @return string Response string. | 
| 104 | 105 | */ | 
| @@ -111,7 +112,7 @@ discard block | ||
| 111 | 112 | /** | 
| 112 | 113 | * Count messages in POP server. | 
| 113 | 114 | * | 
| 114 | - * @return type | |
| 115 | + * @return integer | |
| 115 | 116 | */ | 
| 116 | 117 |      public function countMessages() { | 
| 117 | 118 | fwrite($this->connection, "STAT\r\n"); | 
| @@ -124,7 +125,7 @@ discard block | ||
| 124 | 125 | /** | 
| 125 | 126 | * Return message header. | 
| 126 | 127 | * | 
| 127 | - * @return int $messageNumber Number of the message. | |
| 128 | + * @return string $messageNumber Number of the message. | |
| 128 | 129 | * | 
| 129 | 130 | * @return string | 
| 130 | 131 | */ | 
| @@ -159,9 +160,10 @@ discard block | ||
| 159 | 160 | /** | 
| 160 | 161 | * Return message by number. | 
| 161 | 162 | * | 
| 162 | - * @return int $messageNumber Number of the message | |
| 163 | + * @param integer $messageNumber | |
| 164 | + * @return false|string $messageNumber Number of the message | |
| 163 | 165 | * | 
| 164 | - * @return string | |
| 166 | + * @return false|string | |
| 165 | 167 | */ | 
| 166 | 168 |      public function getMessage($messageNumber) { | 
| 167 | 169 | fwrite($this->connection, "RETR $messageNumber\r\n"); | 
| @@ -58,10 +58,10 @@ discard block | ||
| 58 | 58 | fgets($sock, 1024); | 
| 59 | 59 | |
| 60 | 60 | // Connection accepted | 
| 61 | - fwrite($sock, "USER " . $username . "\r\n"); | |
| 61 | + fwrite($sock, "USER ".$username."\r\n"); | |
| 62 | 62 | $userresponse = fgets($sock, 1024); | 
| 63 | 63 |              if ($userresponse[0] == "+") { // User accepted | 
| 64 | - fwrite($sock, "PASS " . $password . "\r\n"); | |
| 64 | + fwrite($sock, "PASS ".$password."\r\n"); | |
| 65 | 65 | $passresponse = fgets($sock, 1024); | 
| 66 | 66 |                  if ($passresponse[0] != "+") { // Wrong password | 
| 67 | 67 |                      $passresponse = str_replace("\r", "", str_replace("\n", "", $passresponse)); | 
| @@ -72,12 +72,12 @@ discard block | ||
| 72 | 72 | } | 
| 73 | 73 |              } else { // Invalid username | 
| 74 | 74 | throw new POPServerException( | 
| 75 | - "Username '" . $username . "' not accepted.", 1 | |
| 75 | + "Username '".$username."' not accepted.", 1 | |
| 76 | 76 | ); | 
| 77 | 77 | } | 
| 78 | 78 |          } else { | 
| 79 | 79 | throw new POPServerException( | 
| 80 | - "Unable to Connect to " . $host . ". Network Problems could be responsible.", 2 | |
| 80 | + "Unable to Connect to ".$host.". Network Problems could be responsible.", 2 | |
| 81 | 81 | ); | 
| 82 | 82 | } | 
| 83 | 83 | $this->connection = $sock; | 
| @@ -357,8 +357,8 @@ discard block | ||
| 357 | 357 | $ret = $L2 = $L3 = null; | 
| 358 | 358 |          for ($i = 0; $i < $len; $i++) { | 
| 359 | 359 |              if (isset($avar[$i]) && isset($avar[$i][0]) && isset($avar[$i][1]) && isset($avar[$i][2])) { | 
| 360 | - $L2 = $avar[$i][0] . $avar[$i][1]; | |
| 361 | - $L3 = $avar[$i][0] . $avar[$i][1] . $avar[$i][2]; | |
| 360 | + $L2 = $avar[$i][0].$avar[$i][1]; | |
| 361 | + $L3 = $avar[$i][0].$avar[$i][1].$avar[$i][2]; | |
| 362 | 362 |                  if ($L2 != "  " && $L3 != "Rec" && $L2 != "") { | 
| 363 | 363 |                      $avar2 = explode(":", $avar[$i]); | 
| 364 | 364 |                      $temp = str_replace("$avar2[0]:", "", $avar[$i]); | 
| @@ -29,7 +29,7 @@ discard block | ||
| 29 | 29 | |
| 30 | 30 | return $this->sendNotification( | 
| 31 | 31 | Config::EMAIL_ADMIN, | 
| 32 | - "New user signup: '" . $user->username . "'", | |
| 32 | + "New user signup: '".$user->username."'", | |
| 33 | 33 | $_LANG->code, | 
| 34 | 34 | "signup_admin_email", | 
| 35 | 35 | array( | 
| @@ -54,7 +54,7 @@ discard block | ||
| 54 | 54 | global $_LANG; | 
| 55 | 55 | |
| 56 | 56 |          if (!Validator::isEmail($user->email)) { | 
| 57 | -            throw new \Exception("Invalid email: '" . $user->email . "'"); | |
| 57 | +            throw new \Exception("Invalid email: '".$user->email."'"); | |
| 58 | 58 | } | 
| 59 | 59 | |
| 60 | 60 | return $this->sendNotification( | 
| @@ -37,7 +37,7 @@ discard block | ||
| 37 | 37 |          if ($type === 0) { | 
| 38 | 38 | $errorTypes[] = "E_LOG_INFO"; | 
| 39 | 39 |          } else { | 
| 40 | -            for ($i = 0; $i < 15;  $i++) { | |
| 40 | +            for ($i = 0; $i < 15; $i++) { | |
| 41 | 41 | $errorType = self::friendlyErrorType($type & pow(2, $i)); | 
| 42 | 42 |                  if (!empty($errorType)) { | 
| 43 | 43 | $errorTypes[] = $errorType; | 
| @@ -45,7 +45,7 @@ discard block | ||
| 45 | 45 | } | 
| 46 | 46 | } | 
| 47 | 47 | |
| 48 | - $query = "INSERT INTO " . self::TABLE_NAME . " (type, error_type, called, script, line, message, count, last_seen) VALUES (?, ?, ?, ?, ?, ?, 1, ?) | |
| 48 | + $query = "INSERT INTO ".self::TABLE_NAME." (type, error_type, called, script, line, message, count, last_seen) VALUES (?, ?, ?, ?, ?, ?, 1, ?) | |
| 49 | 49 | ON DUPLICATE KEY UPDATE count = count + 1, last_seen = ?"; | 
| 50 | 50 |          try { | 
| 51 | 51 | return DBCore::doUpdateQuery($query, "isssisss", array( | 
| @@ -57,7 +57,7 @@ discard block | ||
| 57 | 57 | } | 
| 58 | 58 | |
| 59 | 59 |      private static function friendlyErrorType($type) { | 
| 60 | -        switch($type) { | |
| 60 | +        switch ($type) { | |
| 61 | 61 | case E_ERROR: // 1 | 
| 62 | 62 | return 'E_ERROR'; | 
| 63 | 63 | case E_WARNING: // 2 | 
| @@ -108,9 +108,9 @@ discard block | ||
| 108 | 108 | * Updates login time. | 
| 109 | 109 | */ | 
| 110 | 110 |      public function updateLoginTime() { | 
| 111 | - $query = "UPDATE " . self::TABLE_NAME . " | |
| 111 | + $query = "UPDATE ".self::TABLE_NAME." | |
| 112 | 112 | SET last_login_time = NOW() | 
| 113 | - WHERE " . self::ID_FIELD_NAME . " = ?"; | |
| 113 | + WHERE " . self::ID_FIELD_NAME." = ?"; | |
| 114 | 114 | DBCore::doUpdateQuery($query, "i", array($this->id)); | 
| 115 | 115 | } | 
| 116 | 116 | |
| @@ -176,8 +176,8 @@ discard block | ||
| 176 | 176 | */ | 
| 177 | 177 |      public function getAvatarPath($icon = false) { | 
| 178 | 178 | $currentAvatarFileName = $this->avatar; | 
| 179 | -        if (!empty($currentAvatarFileName) && file_exists(Config::DIR_AVATARS . $currentAvatarFileName)) { | |
| 180 | - return Config::DIR_AVATARS . $currentAvatarFileName; | |
| 179 | +        if (!empty($currentAvatarFileName) && file_exists(Config::DIR_AVATARS.$currentAvatarFileName)) { | |
| 180 | + return Config::DIR_AVATARS.$currentAvatarFileName; | |
| 181 | 181 | } | 
| 182 | 182 |          if ($icon) { | 
| 183 | 183 | return "img/user_avatar.png"; | 
| @@ -194,14 +194,14 @@ discard block | ||
| 194 | 194 | */ | 
| 195 | 195 |      public function updateAvatar($newAvatarFileName) { | 
| 196 | 196 | $currentAvatarFileName = $this->avatar; | 
| 197 | -        if (!empty($currentAvatarFileName) && file_exists(Config::DIR_AVATARS . $currentAvatarFileName)) { | |
| 198 | - unlink(Config::DIR_AVATARS . $currentAvatarFileName); | |
| 197 | +        if (!empty($currentAvatarFileName) && file_exists(Config::DIR_AVATARS.$currentAvatarFileName)) { | |
| 198 | + unlink(Config::DIR_AVATARS.$currentAvatarFileName); | |
| 199 | 199 | } | 
| 200 | 200 | |
| 201 | -        if (file_exists(Config::DIR_AVATARS . $newAvatarFileName)) { | |
| 202 | - $query = "UPDATE " . self::TABLE_NAME | |
| 201 | +        if (file_exists(Config::DIR_AVATARS.$newAvatarFileName)) { | |
| 202 | + $query = "UPDATE ".self::TABLE_NAME | |
| 203 | 203 | . " SET avatar = ?" | 
| 204 | - . " WHERE " . self::ID_FIELD_NAME . " = ?"; | |
| 204 | + . " WHERE ".self::ID_FIELD_NAME." = ?"; | |
| 205 | 205 | if (DBCore::doUpdateQuery($query, "si", array( | 
| 206 | 206 | $newAvatarFileName, | 
| 207 | 207 | $this->id | 
| @@ -21,7 +21,7 @@ | ||
| 21 | 21 | ); | 
| 22 | 22 | |
| 23 | 23 |      public function save() { | 
| 24 | - $query = "INSERT INTO " . self::TABLE_NAME . " (setting_id, value) VALUES (?, ?) | |
| 24 | + $query = "INSERT INTO ".self::TABLE_NAME." (setting_id, value) VALUES (?, ?) | |
| 25 | 25 | ON DUPLICATE KEY UPDATE value = ?"; | 
| 26 | 26 | return DBCore::doUpdateQuery($query, "sss", array( | 
| 27 | 27 | $this->id, | 
| @@ -88,12 +88,12 @@ discard block | ||
| 88 | 88 | * delivery, FALSE otherwise. | 
| 89 | 89 | */ | 
| 90 | 90 |      protected function sendMail($email, $subject, $message, $format = self::FORMAT_TEXT, $replyTo = "") { | 
| 91 | - $headers = "From: " . $this->fromName . " <" . $this->fromEmail . ">\r\n"; | |
| 92 | - $headers.= "Reply-To: " . $replyTo . "\r\n"; | |
| 91 | + $headers = "From: ".$this->fromName." <".$this->fromEmail.">\r\n"; | |
| 92 | + $headers .= "Reply-To: ".$replyTo."\r\n"; | |
| 93 | 93 | |
| 94 | 94 |          if ($format == self::FORMAT_HTML) { | 
| 95 | - $headers.= "MIME-Version: 1.0\r\n"; | |
| 96 | - $headers.= "Content-type: text/html; charset=utf-8\r\n"; | |
| 95 | + $headers .= "MIME-Version: 1.0\r\n"; | |
| 96 | + $headers .= "Content-type: text/html; charset=utf-8\r\n"; | |
| 97 | 97 | } | 
| 98 | 98 | |
| 99 | 99 | /* | 
| @@ -149,9 +149,9 @@ discard block | ||
| 149 | 149 | $_EMAIL = $params; | 
| 150 | 150 | |
| 151 | 151 | ob_start(); | 
| 152 | - include($this->tplFolder . $languageCode . "/" . $template . ".tpl.php"); | |
| 152 | + include($this->tplFolder.$languageCode."/".$template.".tpl.php"); | |
| 153 | 153 |          if (!empty($this->signatureTpl)) { | 
| 154 | - include($this->tplFolder . $languageCode . "/" . $this->signatureTpl); | |
| 154 | + include($this->tplFolder.$languageCode."/".$this->signatureTpl); | |
| 155 | 155 | } | 
| 156 | 156 | $message = ob_get_contents(); | 
| 157 | 157 | ob_end_clean(); |