Completed
Push — master ( e8d627...417a50 )
by Dmytro
03:37
created
framework/app/View.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -24,6 +24,9 @@
 block discarded – undo
24 24
     private $_messages = array();
25 25
     private $_errors = array();
26 26
 
27
+    /**
28
+     * @param null|Route $tpl
29
+     */
27 30
     public function __construct($tpl) {
28 31
         if (!empty($tpl)) {
29 32
             if (is_string($tpl)) {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
                 $this->_tpl = $tpl;
57 57
             } elseif (Tools::isInstanceOf($tpl, new Route)) {
58 58
                 $this->_route = $tpl;
59
-                $this->_tpl = $this->_route->controller . "/" . $this->_route->controller . "_" . $this->_route->action;
59
+                $this->_tpl = $this->_route->controller."/".$this->_route->controller."_".$this->_route->action;
60 60
             } else {
61 61
                 throw new \Exception("Invalid view template");
62 62
             }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             throw new \Exception("View object was not initialized with template");
71 71
         }
72 72
 
73
-        require_once($path . $this->_tpl . $suffix);
73
+        require_once($path.$this->_tpl.$suffix);
74 74
     }
75 75
 
76 76
     public function setTpl($_tpl) {
Please login to merge, or discard this patch.
framework/db/DBSelector.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -42,6 +42,9 @@
 block discarded – undo
42 42
      */
43 43
     private $dbObject = null;
44 44
 
45
+    /**
46
+     * @param string $className
47
+     */
45 48
     public function __construct($className) {
46 49
         if (is_object($className)) {
47 50
             $className = get_class($className);
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
framework/ui/UIComponent.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@
 block discarded – undo
136 136
      * css($propertyName, $propertyValue) Set the value of a CSS property
137 137
      *
138 138
      * @param string $propertyName Name of a CSS property.
139
-     * @param mixed $propertyValue Value of a CSS property.
139
+     * @param string $propertyValue Value of a CSS property.
140 140
      *
141 141
      * @return Value of the CSS property or NULL if property is not exists.
142 142
      */
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             if (isset($this->$attributeName)) {
113 113
                 $this->$attributeName = $attributeValue;
114 114
             } else {
115
-                throw new \Exception("Wrong attribute '" . $attributeName . "' for " . get_class($this) . " component");
115
+                throw new \Exception("Wrong attribute '".$attributeName."' for ".get_class($this)." component");
116 116
             }
117 117
         }
118 118
     }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
     public function getStyle() {
163 163
         $style = "";
164 164
         foreach ($this->style as $propertyName => $propertyValue) {
165
-            $style .= $propertyName . ":" . $propertyValue . ";";
165
+            $style .= $propertyName.":".$propertyValue.";";
166 166
         }
167 167
 
168 168
         return $style;
Please login to merge, or discard this patch.
framework/db/DBCore.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -598,7 +598,7 @@
 block discarded – undo
598 598
     public static function deleteDBObject($dbObject) {
599 599
         if (!empty($dbObject) && is_object($dbObject)) {
600 600
             $query = "DELETE FROM " . $dbObject->getTableName() .
601
-                     " WHERE " . $dbObject->getIdFieldName() . " = ? LIMIT 1";
601
+                        " WHERE " . $dbObject->getIdFieldName() . " = ? LIMIT 1";
602 602
             if (Tools::isInteger($dbObject->getId())) {
603 603
                 $typesString = "i";
604 604
             } else {
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
      */
127 127
     public function getConnection($connName) {
128 128
         if (!isset($this->connections[$connName])) {
129
-            throw new DBCoreException('Unknown connection: ' . $connName);
129
+            throw new DBCoreException('Unknown connection: '.$connName);
130 130
         }
131 131
 
132 132
         return $this->connections[$connName];
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
                 $resultSet[$field->table] = [];
280 280
             }
281 281
             $resultSet[$field->table][$field->name] = $fieldsCounter++;
282
-            $parameterName = "variable" . $fieldsCounter; //$field->name;
282
+            $parameterName = "variable".$fieldsCounter; //$field->name;
283 283
             $$parameterName = null;
284 284
             $parameters[] = &$$parameterName;
285 285
         }
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
      */
411 411
     public static function getTableFieldsList($tableName) {
412 412
         if (!empty($tableName)) {
413
-            $query = "SHOW FULL COLUMNS FROM " . $tableName;
413
+            $query = "SHOW FULL COLUMNS FROM ".$tableName;
414 414
             $stmt = self::doSelectQuery($query);
415 415
             if ($stmt !== false) {
416 416
                 $stmt->bind_result(
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
          || strpos($type, "datetime") === 0
457 457
          || strpos($type, "timestamp") === 0
458 458
          || strpos($type, "date") === 0) {
459
-            return ('"' . $value . '"');
459
+            return ('"'.$value.'"');
460 460
         } elseif (strpos($type, "int") === 0
461 461
          || strpos($type, "tinyint") === 0
462 462
          || strpos($type, "smallint") === 0
@@ -492,17 +492,17 @@  discard block
 block discarded – undo
492 492
         $extra = trim($attributes['extra']);
493 493
         $comment = trim($attributes['comment']);
494 494
 
495
-        $fieldStr = "'" . $field . "' => ";
495
+        $fieldStr = "'".$field."' => ";
496 496
         if ($attributes['null'] === 'YES' && is_null($attributes['default'])) {
497
-            $fieldStr.= "null";
497
+            $fieldStr .= "null";
498 498
         } else {
499
-            $fieldStr.= self::getPrintableSQLValue($attributes['type'], $attributes['default']);
499
+            $fieldStr .= self::getPrintableSQLValue($attributes['type'], $attributes['default']);
500 500
         }
501
-        $fieldStr.= ", // " . $attributes['type'] .
502
-            ", " . (($attributes['null'] == "NO") ? "not null" : "null")
503
-            . ", default '" . $attributes['default'] . "'" .
504
-            ($extra ? ", " . $extra : "") .
505
-            ($comment ? " (" . $comment . ")" : "") . "\n";
501
+        $fieldStr .= ", // ".$attributes['type'].
502
+            ", ".(($attributes['null'] == "NO") ? "not null" : "null")
503
+            . ", default '".$attributes['default']."'".
504
+            ($extra ? ", ".$extra : "").
505
+            ($comment ? " (".$comment.")" : "")."\n";
506 506
 
507 507
         return $fieldStr;
508 508
     }
@@ -557,12 +557,12 @@  discard block
 block discarded – undo
557 557
         $idFieldName = $dbObject->getIdFieldName();
558 558
 
559 559
         if (Tools::isInteger($fieldsList[$idFieldName])) {
560
-            $query = "INSERT " . ($ignore ? 'IGNORE' : 'INTO') . " " . $dbObject->getTableName() . "
560
+            $query = "INSERT ".($ignore ? 'IGNORE' : 'INTO')." ".$dbObject->getTableName()."
561 561
                           SET " . DBPreparedQuery::sqlQMValuesString($fieldsList, $idFieldName);
562 562
             $typesString = DBPreparedQuery::sqlTypesString($fieldsList, $idFieldName);
563 563
             $valuesList = self::createValuesList($fieldsList, $idFieldName);
564 564
         } else {
565
-            $query = "INSERT " . ($ignore ? 'IGNORE' : 'INTO') . " " . $dbObject->getTableName() . "
565
+            $query = "INSERT ".($ignore ? 'IGNORE' : 'INTO')." ".$dbObject->getTableName()."
566 566
                           SET " . DBPreparedQuery::sqlQMValuesString($fieldsList);
567 567
             $typesString = DBPreparedQuery::sqlTypesString($fieldsList);
568 568
             $valuesList = self::createValuesList($fieldsList);
@@ -591,15 +591,15 @@  discard block
 block discarded – undo
591 591
         $fieldsList = $dbObject->getFieldsList();
592 592
         $idFieldName = $dbObject->getIdFieldName();
593 593
 
594
-        $query = "UPDATE " . $dbObject->getTableName() . "
595
-                  SET " . DBPreparedQuery::sqlQMValuesString($fieldsList, $idFieldName) . "
596
-                  WHERE " . $idFieldName . " = ?
594
+        $query = "UPDATE ".$dbObject->getTableName()."
595
+                  SET " . DBPreparedQuery::sqlQMValuesString($fieldsList, $idFieldName)."
596
+                  WHERE " . $idFieldName." = ?
597 597
                   LIMIT 1";
598 598
         $typesString = DBPreparedQuery::sqlTypesString($fieldsList, $idFieldName);
599 599
         if (Tools::isInteger($fieldsList[$idFieldName])) {
600
-            $typesString.= "i";
600
+            $typesString .= "i";
601 601
         } else {
602
-            $typesString.= "s";
602
+            $typesString .= "s";
603 603
         }
604 604
         $valuesList = self::createValuesList($fieldsList, $idFieldName);
605 605
         $valuesList[] = $dbObject->getId();
@@ -621,8 +621,8 @@  discard block
 block discarded – undo
621 621
      */
622 622
     public static function deleteDBObject($dbObject) {
623 623
         if (!empty($dbObject) && is_object($dbObject)) {
624
-            $query = "DELETE FROM " . $dbObject->getTableName() .
625
-                     " WHERE " . $dbObject->getIdFieldName() . " = ? LIMIT 1";
624
+            $query = "DELETE FROM ".$dbObject->getTableName().
625
+                     " WHERE ".$dbObject->getIdFieldName()." = ? LIMIT 1";
626 626
             if (Tools::isInteger($dbObject->getId())) {
627 627
                 $typesString = "i";
628 628
             } else {
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
                 return null;
675 675
             }
676 676
         } elseif ($stmt->num_rows > 1) {
677
-            throw new DBCoreException("More than single record of '" . $className . "' entity selected");
677
+            throw new DBCoreException("More than single record of '".$className."' entity selected");
678 678
         }
679 679
 
680 680
         return null;
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
      */
850 850
     public static function __callStatic($methodName, $methodParams) {
851 851
         if (strrpos($methodName, "ies") == strlen($methodName) - 3) {
852
-            $methodName = substr($methodName, 0, strlen($methodName) - 3) . "ys";
852
+            $methodName = substr($methodName, 0, strlen($methodName) - 3)."ys";
853 853
         }
854 854
 
855 855
         /*
@@ -896,12 +896,12 @@  discard block
 block discarded – undo
896 896
                 $dbObject = new $className();
897 897
 
898 898
                 if (!isInstanceOf($dbObject, $className)) {
899
-                    throw new DBCoreException("Class with name '" . $className . "' is not exists");
899
+                    throw new DBCoreException("Class with name '".$className."' is not exists");
900 900
                 }
901 901
 
902
-                $query = "DELETE FROM " . $dbObject->getTableName() . "
903
-                          WHERE " . $dbObject->getIdFieldName() . "
904
-                             IN (" . DBPreparedQuery::sqlQMString($itemsNumber) . ")";
902
+                $query = "DELETE FROM ".$dbObject->getTableName()."
903
+                          WHERE " . $dbObject->getIdFieldName()."
904
+                             IN (" . DBPreparedQuery::sqlQMString($itemsNumber).")";
905 905
 
906 906
                 return self::doUpdateQuery($query, $types, $idsList);
907 907
             }
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
          */
915 915
         if (preg_match("#delete([a-zA-Z]+)#", $methodName, $matches)) {
916 916
             return call_user_func(
917
-                [self::getInstance(), $methodName . "s"],
917
+                [self::getInstance(), $methodName."s"],
918 918
                 [$methodParams[0]]
919 919
             );
920 920
         }
@@ -925,7 +925,7 @@  discard block
 block discarded – undo
925 925
         if (preg_match("#set([a-zA-Z]+)Activation#", $methodName, $matches)) {
926 926
             $className = $matches[1];
927 927
             if (strrpos($className, "ies") == strlen($className) - 3) {
928
-                $className = substr($className, 0, strlen($className) - 3) . "y";
928
+                $className = substr($className, 0, strlen($className) - 3)."y";
929 929
             } else {
930 930
                 $className = substr($className, 0, strlen($className) - 1);
931 931
             }
@@ -945,17 +945,17 @@  discard block
 block discarded – undo
945 945
                 $dbObject = new $className();
946 946
 
947 947
                 if (!isInstanceOf($dbObject, $className)) {
948
-                    throw new DBCoreException("Class with name '" . $className . "' is not exists");
948
+                    throw new DBCoreException("Class with name '".$className."' is not exists");
949 949
                 }
950 950
 
951
-                $query = "UPDATE " . $dbObject->getTableName() . " SET `" . $activationFieldName . "` = '" . $activationValue . "'
952
-                          WHERE " . $dbObject->getIdFieldName() . " IN (" . DBPreparedQuery::sqlQMString($itemsNumber) . ")";
951
+                $query = "UPDATE ".$dbObject->getTableName()." SET `".$activationFieldName."` = '".$activationValue."'
952
+                          WHERE " . $dbObject->getIdFieldName()." IN (".DBPreparedQuery::sqlQMString($itemsNumber).")";
953 953
 
954 954
                 return self::doUpdateQuery($query, $types, $idsList);
955 955
             }
956 956
         }
957 957
 
958
-        throw new DBCoreException('No such method "' . $methodName . '"');
958
+        throw new DBCoreException('No such method "'.$methodName.'"');
959 959
     }
960 960
 
961 961
 }
Please login to merge, or discard this patch.
framework/db/DBPreparedQuery.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -139,9 +139,9 @@
 block discarded – undo
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 .
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      */
84 84
     public function prepareConditions() {
85 85
         if (!empty($this->conditions)) {
86
-            $this->query.= " WHERE ";
86
+            $this->query .= " WHERE ";
87 87
             $this->sqlPushValues($this->conditions, " AND ");
88 88
         }
89 89
     }
@@ -93,14 +93,14 @@  discard block
 block discarded – undo
93 93
      */
94 94
     public function prepareOrder() {
95 95
         if (!empty($this->order)) {
96
-            $this->query.= " ORDER BY";
96
+            $this->query .= " ORDER BY";
97 97
             if (is_array($this->order)) {
98 98
                 foreach ($this->order as $fieldName => $ord) {
99
-                    $this->query.= " " . $fieldName . " " . $ord . ",";
99
+                    $this->query .= " ".$fieldName." ".$ord.",";
100 100
                 }
101 101
                 $this->query = substr($this->query, 0, strlen($this->query) - 1);
102 102
             } elseif (is_string($this->order)) {
103
-                $this->query.= " " . $this->order;
103
+                $this->query .= " ".$this->order;
104 104
             }
105 105
         }
106 106
     }
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
     public function prepareLimit() {
114 114
         if (!is_null($this->limit)) {
115 115
             if (Tools::isInteger($this->limit)) {
116
-                $this->query.= " LIMIT " . $this->limit;
116
+                $this->query .= " LIMIT ".$this->limit;
117 117
                 $count = $this->limit;
118 118
             } elseif (is_array($this->limit) && count($this->limit) == 2) {
119 119
                 $offset = $this->limit[0];
120 120
                 $count = $this->limit[1];
121 121
                 if (Tools::isInteger($offset) && Tools::isInteger($count)) {
122
-                    $this->query.= " LIMIT " . $offset . ", " . $count;
122
+                    $this->query .= " LIMIT ".$offset.", ".$count;
123 123
                 } else {
124 124
                     throw new DBCoreException("Invalid LIMIT param in select() method.");
125 125
                 }
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 
223 223
             if (!in_array($type, ['i', 'd', 's', 'b'])) {
224 224
                 throw new DBCoreException(
225
-                    "Invalid query parameters types string (type '" . $type .
225
+                    "Invalid query parameters types string (type '".$type.
226 226
                     "' is undefined, only 'i', 'd', 's' and 'b' types are acceptable)"
227 227
                 );
228 228
             }
@@ -235,8 +235,8 @@  discard block
 block discarded – undo
235 235
                    )
236 236
                 ) {
237 237
                     throw new DBCoreException(
238
-                        "Invalid query parameters types string ('" . $value .
239
-                        "' is not '" . $type . "' type but '" . $typeByValue . "' detected)"
238
+                        "Invalid query parameters types string ('".$value.
239
+                        "' is not '".$type."' type but '".$typeByValue."' detected)"
240 240
                     );
241 241
                 }
242 242
             } else { // in case if we try send non-string parameters as a string value
@@ -244,21 +244,21 @@  discard block
 block discarded – undo
244 244
                     case 'i':
245 245
                         if (!(Tools::isNumeric($value) && ((string)(int)$value === $value))) {
246 246
                             throw new DBCoreException(
247
-                                "Invalid query parameters types string ('" . $value . "' is not '" . $type . ")"
247
+                                "Invalid query parameters types string ('".$value."' is not '".$type.")"
248 248
                             );
249 249
                         }
250 250
                         break;
251 251
                     case 'd':
252 252
                         if (!Tools::isDoubleString($value)) {
253 253
                             throw new DBCoreException(
254
-                                "Invalid query parameters types string ('" . $value . "' is not '" . $type . ")"
254
+                                "Invalid query parameters types string ('".$value."' is not '".$type.")"
255 255
                             );
256 256
                         }
257 257
                         break;
258 258
                     case 'b':
259 259
                         if (!in_array(strtolower($value), ['true', 'false'])) {
260 260
                             throw new DBCoreException(
261
-                                "Invalid query parameters types string ('" . $value . "' is not '" . $type . ")"
261
+                                "Invalid query parameters types string ('".$value."' is not '".$type.")"
262 262
                             );
263 263
                         }
264 264
                         break;
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
         $chunks = [];
291 291
         foreach (array_keys($fieldsList) as $fieldName) {
292 292
             if ($fieldName != $idFieldName) {
293
-                $chunks[] = "`" . $fieldName . "` = ?";
293
+                $chunks[] = "`".$fieldName."` = ?";
294 294
             }
295 295
         }
296 296
 
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
         $chunks = [];
310 310
         foreach ($fieldsList as $fieldName => $fieldValue) {
311 311
             if ($fieldName != $idFieldName) {
312
-                $chunks[]= "`" . $fieldName . "` = '" . $fieldValue . "'";
312
+                $chunks[] = "`".$fieldName."` = '".$fieldValue."'";
313 313
             }
314 314
         }
315 315
 
@@ -333,11 +333,11 @@  discard block
 block discarded – undo
333 333
         foreach ($fieldsList as $fieldName => $fieldValue) {
334 334
             if ($fieldName != $idFieldName) {
335 335
                 if (Tools::isDouble($fieldValue)) {
336
-                    $typesString.= "d";
336
+                    $typesString .= "d";
337 337
                 } elseif (Tools::isInteger($fieldValue)) {
338
-                    $typesString.= "i";
338
+                    $typesString .= "i";
339 339
                 } else {
340
-                    $typesString.= "s";
340
+                    $typesString .= "s";
341 341
                 }
342 342
             }
343 343
         }
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
         $type = DBField::castType($type);
359 359
         $typesString = "";
360 360
         while ($length > 0) {
361
-            $typesString.= $type;
361
+            $typesString .= $type;
362 362
             $length--;
363 363
         }
364 364
 
@@ -377,8 +377,8 @@  discard block
 block discarded – undo
377 377
         foreach ($values as $fieldName => $fieldValue) {
378 378
             if (!is_array($fieldValue)) {
379 379
                 if (!is_null($fieldValue)) {
380
-                    $chunks[] = $fieldName . " = ?";
381
-                    $this->types.= DBField::getType($fieldValue);
380
+                    $chunks[] = $fieldName." = ?";
381
+                    $this->types .= DBField::getType($fieldValue);
382 382
                     $this->params[] = $fieldValue;
383 383
                 } else {
384 384
                     $chunks[] = $fieldName;
@@ -389,12 +389,12 @@  discard block
 block discarded – undo
389 389
 
390 390
                 $chunks[] = $condition;
391 391
                 foreach ($localParams as $param) {
392
-                    $this->types.= DBField::getType($param);
392
+                    $this->types .= DBField::getType($param);
393 393
                     $this->params[] = $param;
394 394
                 }
395 395
             }
396 396
         }
397
-        $this->query.= implode($separator, $chunks);
397
+        $this->query .= implode($separator, $chunks);
398 398
     }
399 399
 
400 400
 }
Please login to merge, or discard this patch.
framework/helpers/Naming.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@
 block discarded – undo
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
                 }
Please login to merge, or discard this patch.
framework/core/Messages.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@
 block discarded – undo
132 132
      */
133 133
     public static function reorderMessages()
134 134
     {
135
-        uasort(self::$messages, function ($a, $b) {
135
+        uasort(self::$messages, function($a, $b) {
136 136
             return $a->type <= $b->type;
137 137
         });
138 138
     }
Please login to merge, or discard this patch.
framework/mail/POP.php 2 patches
Doc Comments   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -98,7 +98,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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");
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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]);
Please login to merge, or discard this patch.
framework/db/DBObject.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
     /**
54 54
      * Sets primary key value.
55 55
      *
56
-     * @param mixed $recordId Key vaue.
56
+     * @param integer $recordId Key vaue.
57 57
      *
58
-     * @return bool Success flag.
58
+     * @return DBObject Success flag.
59 59
      * @throws DBCoreException If object has no field with such name.
60 60
      */
61 61
     public function setId($recordId) {
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
      * @param bool $ignore Ignore unique indexes or not.
256 256
      * @param bool Debug mode flag.
257 257
      *
258
-     * @return mixed Primary key value.
258
+     * @return integer Primary key value.
259 259
      * @throws DBCoreException If some database error occurred.
260 260
      */
261 261
     public function insert($ignore = false,  $debug = false) {
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
     /**
515 515
      * Deletes DB record for current DBObject.
516 516
      *
517
-     * @return mixed Number of affected rows (1 if some record was deleted,
517
+     * @return integer Number of affected rows (1 if some record was deleted,
518 518
      *            0 - if no) or FALSE if some error occurred.
519 519
      */
520 520
     public function delete() {
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -88,9 +88,9 @@  discard block
 block discarded – undo
88 88
      */
89 89
     public function saveActivationFlag() {
90 90
         return DBCore::doUpdateQuery(
91
-            "UPDATE " . static::TABLE_NAME . "
91
+            "UPDATE ".static::TABLE_NAME."
92 92
                 SET activation = ?
93
-             WHERE " . static::ID_FIELD_NAME . " = ?
93
+             WHERE " . static::ID_FIELD_NAME." = ?
94 94
              LIMIT 1",
95 95
             "ii",
96 96
             [$this->activation, $this->id]
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
      */
155 155
     public function saveRemovementFlag() {
156 156
         return DBCore::doUpdateQuery(
157
-            "UPDATE " . static::TABLE_NAME . "
157
+            "UPDATE ".static::TABLE_NAME."
158 158
                 SET removed = ?
159
-             WHERE " . static::ID_FIELD_NAME . " = ?
159
+             WHERE " . static::ID_FIELD_NAME." = ?
160 160
              LIMIT 1",
161 161
             "ii",
162 162
             [$this->removed, $this->id]
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
      */
358 358
     public static function _count($conditions = [], $debug = false) {
359 359
         $dbQuery = (new DBPreparedQuery())->prepare(
360
-            "SELECT COUNT(*) as 'val' FROM " . static::TABLE_NAME,
360
+            "SELECT COUNT(*) as 'val' FROM ".static::TABLE_NAME,
361 361
             $conditions
362 362
         );
363 363
 
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
      */
379 379
     public static function _max($field, $conditions = [], $debug = false) {
380 380
         $dbQuery = (new DBPreparedQuery())->prepare(
381
-            "SELECT MAX(`" . $field . "`) as 'val' FROM " . static::TABLE_NAME,
381
+            "SELECT MAX(`".$field."`) as 'val' FROM ".static::TABLE_NAME,
382 382
             $conditions
383 383
         );
384 384
 
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
      */
400 400
     public static function _min($field, $conditions = [], $debug = false) {
401 401
         $dbQuery = (new DBPreparedQuery())->prepare(
402
-            "SELECT MIN(`" . $field . "`) as 'val' FROM " . static::TABLE_NAME,
402
+            "SELECT MIN(`".$field."`) as 'val' FROM ".static::TABLE_NAME,
403 403
             $conditions
404 404
         );
405 405
 
@@ -485,14 +485,14 @@  discard block
 block discarded – undo
485 485
     public function go($debug = false) {
486 486
         switch ($this->dbQuery->getType()) {
487 487
             case (DBQueryType::SELECT):
488
-                $this->dbQuery->query = "SELECT * FROM " . static::TABLE_NAME;
488
+                $this->dbQuery->query = "SELECT * FROM ".static::TABLE_NAME;
489 489
                 break;
490 490
             case (DBQueryType::UPDATE):
491
-                $this->dbQuery->query = "UPDATE " . static::TABLE_NAME . " SET ";
491
+                $this->dbQuery->query = "UPDATE ".static::TABLE_NAME." SET ";
492 492
                 $this->dbQuery->sqlPushValues($this->dbQuery->fields);
493 493
                 break;
494 494
             case (DBQueryType::DELETE):
495
-                $this->dbQuery->query = "DELETE FROM " . static::TABLE_NAME;
495
+                $this->dbQuery->query = "DELETE FROM ".static::TABLE_NAME;
496 496
                 break;
497 497
         }
498 498
 
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
         if ($this->isNewRecord()) {
503 503
             $this->dbQuery->prepareConditions();
504 504
         } else {
505
-            $this->dbQuery->query.= " WHERE ";
505
+            $this->dbQuery->query .= " WHERE ";
506 506
             $this->dbQuery->sqlPushValues([static::ID_FIELD_NAME => $this->id]);
507 507
         }
508 508
 
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
         if ($this->isNewRecord()) {
521 521
             $count = $this->dbQuery->prepareLimit();
522 522
         } else {
523
-            $this->dbQuery->query.= " LIMIT 1";
523
+            $this->dbQuery->query .= " LIMIT 1";
524 524
             $count = 1;
525 525
         }
526 526
 
Please login to merge, or discard this patch.