Passed
Push — master ( 42b575...2cff8f )
by Dmytro
02:57
created
framework/app/View.php 1 patch
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.
framework/db/DBCore.php 3 patches
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -271,7 +271,6 @@  discard block
 block discarded – undo
271 271
      * Return parameters from the statment with dynamic number of parameters.
272 272
      *
273 273
      * @param resource $stmt Statement.
274
-     * @param array $params Parameters.
275 274
      */
276 275
     public static function bindResults($stmt) {
277 276
         $resultSet = array();
@@ -769,7 +768,7 @@  discard block
 block discarded – undo
769 768
     /**
770 769
      * Executes SQL query with single record and value result and return this value.
771 770
      *
772
-     * @param mixed $query SQL query template string or DBPreparedQuery object
771
+     * @param string $query SQL query template string or DBPreparedQuery object
773 772
      *           if single parameter.
774 773
      * @param string $types Types string (ex: "isdb").
775 774
      * @param array $params Parameters in the same order like types string.
Please login to merge, or discard this patch.
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   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -481,11 +481,11 @@  discard block
 block discarded – undo
481 481
 
482 482
         $fieldStr = "'" . $field . "' => ";
483 483
         if ($attributes['null'] === 'YES' && is_null($attributes['default'])) {
484
-            $fieldStr.= "null";
484
+            $fieldStr .= "null";
485 485
         } else {
486
-            $fieldStr.= self::getPrintableSQLValue($attributes['type'], $attributes['default']);
486
+            $fieldStr .= self::getPrintableSQLValue($attributes['type'], $attributes['default']);
487 487
         }
488
-        $fieldStr.= ", // " . $attributes['type'] .
488
+        $fieldStr .= ", // " . $attributes['type'] .
489 489
             ", " . (($attributes['null'] == "NO") ? "not null" : "null")
490 490
             . ", default '" . $attributes['default'] . "'" .
491 491
             ($extra ? ", " . $extra : "") .
@@ -583,9 +583,9 @@  discard block
 block discarded – undo
583 583
                   LIMIT 1";
584 584
         $typesString = DBPreparedQuery::sqlTypesString($fieldsList, $idFieldName);
585 585
         if (Tools::isInteger($fieldsList[$idFieldName])) {
586
-            $typesString.= "i";
586
+            $typesString .= "i";
587 587
         } else {
588
-            $typesString.= "s";
588
+            $typesString .= "s";
589 589
         }
590 590
         $valuesList = self::createValuesList($fieldsList, $idFieldName);
591 591
         $valuesList[] = $dbObject->getId();
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   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 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) {
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 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);
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 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) {
Please login to merge, or discard this patch.
framework/mail/POP.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@
 block discarded – undo
110 110
     /**
111 111
      * Count messages in POP server.
112 112
      *
113
-     * @return type
113
+     * @return integer
114 114
      */
115 115
     public function countMessages() {
116 116
         fputs($this->connection, "STAT\r\n");
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -131,10 +131,10 @@  discard block
 block discarded – undo
131 131
         fputs($this->connection, "TOP $messageNumber 0\r\n");
132 132
         $buffer = "";
133 133
         $headerReceived = 0;
134
-        while( $headerReceived == 0 ) {
135
-            $temp = fgets( $this->connection, 1024 );
134
+        while ($headerReceived == 0) {
135
+            $temp = fgets($this->connection, 1024);
136 136
             $buffer .= $temp;
137
-            if( $temp == ".\r\n" ) {
137
+            if ($temp == ".\r\n") {
138 138
                 $headerReceived = 1;
139 139
             }
140 140
         }
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
     public function getMessages() {
187 187
         $messages = [];
188 188
 
189
-        for ($i=1; ; $i++) {
189
+        for ($i = 1; ; $i++) {
190 190
             $message = $this->getMessage($i);
191 191
             if ($message === false) {
192 192
                 break;
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
     public function getBouncedEmails($delete = true, $number = null) {
206 206
         $emails = [];
207 207
 
208
-        for ($i = 1; (is_null($number) ? true : $i <= $number) ; $i++) {
208
+        for ($i = 1; (is_null($number) ? true : $i <= $number); $i++) {
209 209
             $message = $this->getMessage($i);
210 210
             if ($message !== false) {
211 211
                 $markers = [
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
     public function getEmails($delete = true, $number = null) {
266 266
         $emails = [];
267 267
 
268
-        for ($i = 1; (is_null($number) ? true : $i <= $number) ; $i++) {
268
+        for ($i = 1; (is_null($number) ? true : $i <= $number); $i++) {
269 269
             $message = $this->getMessage($i);
270 270
             if ($message !== false) {
271 271
                 $failSignaturePos = 0;
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
         $len = count($avar);
351 351
         $ret = $L2 = $L3 = null;
352 352
         for ($i = 0; $i < $len; $i++) {
353
-            if( isset( $avar[$i] ) && isset( $avar[$i][0] ) && isset( $avar[$i][1] ) && isset( $avar[$i][2] ) ){
353
+            if (isset($avar[$i]) && isset($avar[$i][0]) && isset($avar[$i][1]) && isset($avar[$i][2])) {
354 354
                 $L2 = $avar[$i][0] . $avar[$i][1];
355 355
                 $L3 = $avar[$i][0] . $avar[$i][1] . $avar[$i][2];
356 356
                 if ($L2 != "  " && $L3 != "Rec" && $L2 != "") {
Please login to merge, or discard this patch.
framework/ui/controls/UIPagination.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -62,6 +62,9 @@
 block discarded – undo
62 62
         $this->lastPage = $this->currentPage + $this->pagesOffset;
63 63
     }
64 64
 
65
+    /**
66
+     * @param integer $currentPage
67
+     */
65 68
     public function setCurrentPage($currentPage) {
66 69
         if (Tools::isInteger($currentPage)) {
67 70
             if ($currentPage < 0) {
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,8 +77,12 @@
 block discarded – undo
77 77
     public static function getCurrentPageNumber($page, $totalPages) {
78 78
         $page = (integer)$page;
79 79
 
80
-        if ($page < 1) return 1;
81
-        if ($page > $totalPages) return $totalPages;
80
+        if ($page < 1) {
81
+            return 1;
82
+        }
83
+        if ($page > $totalPages) {
84
+            return $totalPages;
85
+        }
82 86
         return $page;
83 87
     }
84 88
 
Please login to merge, or discard this patch.
framework/ui/UIComponent.php 1 patch
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.
framework/db/DBObject.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -414,11 +414,11 @@  discard block
 block discarded – undo
414 414
          */
415 415
         if ($this->isNewRecord()) {
416 416
             if (!empty($this->dbQuery->conditions)) {
417
-                $this->dbQuery->query.= " WHERE ";
417
+                $this->dbQuery->query .= " WHERE ";
418 418
                 $this->dbQuery->sqlPushValues($this->dbQuery->conditions, " AND ");
419 419
             }
420 420
         } else {
421
-            $this->dbQuery->query.= " WHERE ";
421
+            $this->dbQuery->query .= " WHERE ";
422 422
             $this->dbQuery->sqlPushValues([static::ID_FIELD_NAME => $this->id]);
423 423
         }
424 424
 
@@ -427,14 +427,14 @@  discard block
 block discarded – undo
427 427
          */
428 428
         if ($this->isNewRecord()) {
429 429
             if (!empty($this->dbQuery->order)) {
430
-                $this->dbQuery->query.= " ORDER BY";
430
+                $this->dbQuery->query .= " ORDER BY";
431 431
                 if (is_array($this->dbQuery->order)) {
432 432
                     foreach ($this->dbQuery->order as $fieldName => $ord) {
433
-                        $this->dbQuery->query.= " " . $fieldName . " " . $ord . ",";
433
+                        $this->dbQuery->query .= " " . $fieldName . " " . $ord . ",";
434 434
                     }
435 435
                     $this->dbQuery->query = substr($this->dbQuery->query, 0, strlen($this->dbQuery->query) - 1);
436 436
                 } elseif (is_string($this->dbQuery->order)) {
437
-                    $this->dbQuery->query.= " " . $this->dbQuery->order;
437
+                    $this->dbQuery->query .= " " . $this->dbQuery->order;
438 438
                 }
439 439
             }
440 440
         }
@@ -446,13 +446,13 @@  discard block
 block discarded – undo
446 446
         if ($this->isNewRecord()) {
447 447
             if (!is_null($this->dbQuery->limit)) {
448 448
                 if (Tools::isInteger($this->dbQuery->limit)) {
449
-                    $this->dbQuery->query.= " LIMIT " . $this->dbQuery->limit;
449
+                    $this->dbQuery->query .= " LIMIT " . $this->dbQuery->limit;
450 450
                     $count = $this->dbQuery->limit;
451 451
                 } elseif (is_array($this->dbQuery->limit) && count($this->dbQuery->limit) == 2) {
452 452
                     $offset = $this->dbQuery->limit[0];
453 453
                     $count = $this->dbQuery->limit[1];
454 454
                     if (Tools::isInteger($offset) && Tools::isInteger($count)) {
455
-                        $this->dbQuery->query.= " LIMIT " . $offset . ", " . $count;
455
+                        $this->dbQuery->query .= " LIMIT " . $offset . ", " . $count;
456 456
                     } else {
457 457
                         throw new DBCoreException("Invalid LIMIT param in select() method.");
458 458
                     }
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
                 }
462 462
             }
463 463
         } else {
464
-            $this->dbQuery->query.= " LIMIT 1";
464
+            $this->dbQuery->query .= " LIMIT 1";
465 465
             $count = 1;
466 466
         }
467 467
 
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
     /**
59 59
      * Sets primary key value.
60 60
      *
61
-     * @param mixed $recordId Key vaue.
61
+     * @param integer $recordId Key vaue.
62 62
      *
63 63
      * @throws DBCoreException If object has no field with such name.
64 64
      *
65
-     * @return bool Success flag.
65
+     * @return DBObject Success flag.
66 66
      */
67 67
     public function setId($recordId)
68 68
     {
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
     /**
533 533
      * Deletes DB record for current DBObject.
534 534
      *
535
-     * @return mixed Number of affected rows (1 if some record was deleted,
535
+     * @return integer Number of affected rows (1 if some record was deleted,
536 536
      *               0 - if no) or FALSE if some error occurred.
537 537
      */
538 538
     public function delete()
Please login to merge, or discard this patch.
framework/db/DBQueryCondition.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                     break;
107 107
                 case ("IN"):
108 108
                 case ("NOT IN"):
109
-                    if (is_array($value) &&  !empty($value)) {
109
+                    if (is_array($value) && !empty($value)) {
110 110
                         $dataList = [];
111 111
                         foreach ($value as $dataItem) {
112 112
                             $dataList[] = DBField::sqlValue($this->field->type, $dataItem);
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
                         if ($count > 0) {
117 117
                             $qmStr = "?";
118 118
                             $tStr = $this->field->type;
119
-                            for ($i = 1; $i < $count; $i ++) {
119
+                            for ($i = 1; $i < $count; $i++) {
120 120
                                 $qmStr .= ", ?";
121 121
                                 $tStr .= $this->field->type;
122 122
                             }
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   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         $chunks = [];
220 220
         foreach ($fieldsList as $fieldName => $fieldValue) {
221 221
             if ($fieldName != $idFieldName) {
222
-                $chunks[]= "`" . $fieldName . "` = '" . $fieldValue . "'";
222
+                $chunks[] = "`" . $fieldName . "` = '" . $fieldValue . "'";
223 223
             }
224 224
         }
225 225
 
@@ -243,11 +243,11 @@  discard block
 block discarded – undo
243 243
         foreach ($fieldsList as $fieldName => $fieldValue) {
244 244
             if ($fieldName != $idFieldName) {
245 245
                 if (Tools::isDouble($fieldValue)) {
246
-                    $typesString.= "d";
246
+                    $typesString .= "d";
247 247
                 } elseif (Tools::isInteger($fieldValue)) {
248
-                    $typesString.= "i";
248
+                    $typesString .= "i";
249 249
                 } else {
250
-                    $typesString.= "s";
250
+                    $typesString .= "s";
251 251
                 }
252 252
             }
253 253
         }
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
         $type = DBField::castType($type);
269 269
         $typesString = "";
270 270
         while ($length > 0) {
271
-            $typesString.= $type;
271
+            $typesString .= $type;
272 272
             $length--;
273 273
         }
274 274
 
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
             if (!is_array($fieldValue)) {
289 289
                 if (!is_null($fieldValue)) {
290 290
                     $chunks[] = $fieldName . " = ?";
291
-                    $this->types.= DBField::getType($fieldValue);
291
+                    $this->types .= DBField::getType($fieldValue);
292 292
                     $this->params[] = $fieldValue;
293 293
                 } else {
294 294
                     $chunks[] = $fieldName;
@@ -299,12 +299,12 @@  discard block
 block discarded – undo
299 299
 
300 300
                 $chunks[] = $condition;
301 301
                 foreach ($localParams as $param) {
302
-                    $this->types.= DBField::getType($param);
302
+                    $this->types .= DBField::getType($param);
303 303
                     $this->params[] = $param;
304 304
                 }
305 305
             }
306 306
         }
307
-        $this->query.= implode($separator, $chunks);
307
+        $this->query .= implode($separator, $chunks);
308 308
     }
309 309
 
310 310
 }
Please login to merge, or discard this patch.