Test Failed
Push — 1.0.0-dev ( 62b9b2...317ddd )
by nguereza
03:01
created
core/classes/database/DatabaseConnection.php 2 patches
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -42,28 +42,28 @@  discard block
 block discarded – undo
42 42
          */
43 43
         private $driver = null;
44 44
 
45
-         /**
46
-         * The database hostname
47
-         * @var string
48
-         */
45
+            /**
46
+             * The database hostname
47
+             * @var string
48
+             */
49 49
         private $hostname = null;
50 50
 
51
-          /**
52
-         * The database port
53
-         * @var integer
54
-         */
51
+            /**
52
+             * The database port
53
+             * @var integer
54
+             */
55 55
         private $port = null;
56 56
         
57
-         /**
58
-         * The database username
59
-         * @var string
60
-         */
57
+            /**
58
+             * The database username
59
+             * @var string
60
+             */
61 61
         private $username = null;
62 62
 
63
-         /**
64
-         * The database password
65
-         * @var string
66
-         */
63
+            /**
64
+             * The database password
65
+             * @var string
66
+             */
67 67
         private $password = null;
68 68
 
69 69
         /**
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
          */
73 73
         private $databaseName = null;
74 74
 
75
-         /**
76
-         * The database charset
77
-         * @var string
78
-         */
75
+            /**
76
+             * The database charset
77
+             * @var string
78
+             */
79 79
         private $charset = null;
80 80
 
81 81
         /**
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
          */
85 85
         private $collation = null;
86 86
 
87
-         /**
88
-         * The database tables prefix
89
-         * @var string
90
-         */
87
+            /**
88
+             * The database tables prefix
89
+             * @var string
90
+             */
91 91
         private $prefix = null;
92 92
 
93 93
         /**
@@ -113,11 +113,11 @@  discard block
 block discarded – undo
113 113
             }
114 114
         }
115 115
 
116
-         /**
117
-         * This is method is used to connect to database
118
-         * 
119
-         * @return boolean true in case of successfully connection false if error
120
-         */
116
+            /**
117
+             * This is method is used to connect to database
118
+             * 
119
+             * @return boolean true in case of successfully connection false if error
120
+             */
121 121
         public function connect() {
122 122
             try {
123 123
                 if(empty($this->config) && file_exists(CONFIG_PATH . 'database.php')) {
@@ -182,9 +182,9 @@  discard block
 block discarded – undo
182 182
             );
183 183
             if ($port) {
184 184
                 $driversPort = array(
185
-                      'mysql'  => 'port=' . $port . ';',
186
-                      'pgsql'  => 'port=' . $port . ';',
187
-                      'oracle' => ':' . $port
185
+                        'mysql'  => 'port=' . $port . ';',
186
+                        'pgsql'  => 'port=' . $port . ';',
187
+                        'oracle' => ':' . $port
188 188
                 );
189 189
                 if (isset($driversPort[$driver])) {
190 190
                     $port = $driversPort[$driver];
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
             $this->populatePropertiesFromConfig();
423 423
 
424 424
             if (!empty($this->config)) {
425
-               //For logging
425
+                //For logging
426 426
                 $configInfo = $this->config;
427 427
                 //Hide password from log
428 428
                 $configInfo['password'] = string_hidden($this->getPassword());
@@ -431,11 +431,11 @@  discard block
 block discarded – undo
431 431
             return $this;
432 432
         }
433 433
         
434
-         /**
435
-         * Update the properties using the current database configuration
436
-         * 
437
-         * @return object the current instance
438
-         */
434
+            /**
435
+             * Update the properties using the current database configuration
436
+             * 
437
+             * @return object the current instance
438
+             */
439 439
         protected function populatePropertiesFromConfig() {
440 440
             foreach ($this->config as $key => $value) {
441 441
                 $setter = 'set' . ucfirst($key);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
          */
121 121
         public function connect() {
122 122
             try {
123
-                if(empty($this->config) && file_exists(CONFIG_PATH . 'database.php')) {
123
+                if (empty($this->config) && file_exists(CONFIG_PATH . 'database.php')) {
124 124
                     $db = array();
125 125
                     require CONFIG_PATH . 'database.php';
126 126
                     //Note need use the method to set config
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                     PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ
131 131
                 );
132 132
                 $this->pdo = new PDO($this->getDsn(), $this->getUsername(), $this->getPassword(), $options);
133
-                if($this->getDriver() == 'mysql') {
133
+                if ($this->getDriver() == 'mysql') {
134 134
                     $this->pdo->exec("SET NAMES '" . $this->getCharset() . "' COLLATE '" . $this->getCollation() . "'");
135 135
                     $this->pdo->exec("SET CHARACTER SET '" . $this->getCharset() . "'");
136 136
                 }
Please login to merge, or discard this patch.
core/classes/database/DatabaseCache.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         public function getCacheContent() {
158 158
             //set some attributes values
159 159
             $this->setPropertiesValues();
160
-            if (! $this->canUseCache()) {
160
+            if (!$this->canUseCache()) {
161 161
                 $this->logger->info('The cache is not enabled for this query or is not a SELECT query'); 
162 162
                 return null;
163 163
             }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         public function setCacheContent($result) {
179 179
             //set some attributes values
180 180
             $this->setPropertiesValues();
181
-            if (! $this->canUseCache()) {
181
+            if (!$this->canUseCache()) {
182 182
                 $this->logger->info('The cache is not enabled for this query or is not a SELECT query'); 
183 183
                 return null;
184 184
             }
Please login to merge, or discard this patch.
core/classes/model/Model.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
     class Model {
32 32
 
33
-       /**
33
+        /**
34 34
          * This model's default database table. 
35 35
          * @var string the name of table
36 36
          */
@@ -173,12 +173,12 @@  discard block
 block discarded – undo
173 173
             if ($db !== null) {
174 174
                 $this->setDb($db);
175 175
             } else {
176
-                 /**
177
-                 * NOTE: Need use "clone" because some Model need have the personal instance of the database library
178
-                 * to prevent duplication
179
-                 */
180
-                 $obj = & get_instance();
181
-                 $this->setDb(clone $obj->database);
176
+                    /**
177
+                     * NOTE: Need use "clone" because some Model need have the personal instance of the database library
178
+                     * to prevent duplication
179
+                     */
180
+                    $obj = & get_instance();
181
+                    $this->setDb(clone $obj->database);
182 182
             }
183 183
             array_unshift($this->beforeCreateCallbacks, 'removeProtectedTableColumns');
184 184
             array_unshift($this->beforeUpdateCallbacks, 'removeProtectedTableColumns');
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
          * Only get deleted rows on the next call
593 593
          * 
594 594
          * @return object the current instance
595
-        */
595
+         */
596 596
         public function onlyRecordDeleted() {
597 597
             $this->returnOnlyRecordDeleted = true;
598 598
             return $this;
@@ -618,8 +618,8 @@  discard block
 block discarded – undo
618 618
          * @return array the data after add field for updated time
619 619
          */
620 620
         public function updatedAt($row) {
621
-           $row['updated_at'] = date('Y-m-d H:i:s');
622
-           return $row;
621
+            $row['updated_at'] = date('Y-m-d H:i:s');
622
+            return $row;
623 623
         }
624 624
 
625 625
         /**
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
          */
733 733
         protected function removeProtectedTableColumns($row) {
734 734
             foreach ($this->protectedTableColumns as $attr) {
735
-               if (isset($row[$attr])) {
735
+                if (isset($row[$attr])) {
736 736
                     unset($row[$attr]);
737 737
                 }
738 738
             }
@@ -787,23 +787,23 @@  discard block
 block discarded – undo
787 787
             return false;
788 788
         }
789 789
 
790
-         /**
791
-         * Get the record return type array or object
792
-         * 
793
-         * @return string|boolean
794
-         */
790
+            /**
791
+             * Get the record return type array or object
792
+             * 
793
+             * @return string|boolean
794
+             */
795 795
         protected function getReturnType(){
796 796
             $type = false;
797 797
             if ($this->temporaryReturnRecordType == 'array') {
798
-               $type = 'array';
798
+                $type = 'array';
799 799
             }
800 800
             return $type;
801 801
         }
802 802
 
803
-         /**
804
-         * Check if soft delete is enable setting the condition
805
-         * @return object the current instance 
806
-         */
803
+            /**
804
+             * Check if soft delete is enable setting the condition
805
+             * @return object the current instance 
806
+             */
807 807
         protected function checkForSoftDelete(){
808 808
             if ($this->softDeleteStatus && $this->returnRecordWithDeleted !== true) {
809 809
                 $this->getQueryBuilder()->where(
@@ -814,16 +814,16 @@  discard block
 block discarded – undo
814 814
             return $this;
815 815
         }
816 816
 
817
-         /**
818
-         * Relate for "manyToOne" and "oneToMany"
819
-         * 
820
-         * @param  string $relationship the name of relation
821
-         * @param  string|array $options      the model and primary key values
822
-         * @param  object|array $row          the row to update
823
-         * @param  string $type the type can be "manyToOne", "oneToMany"
824
-         * 
825
-         * @return array|object the final row values
826
-         */
817
+            /**
818
+             * Relate for "manyToOne" and "oneToMany"
819
+             * 
820
+             * @param  string $relationship the name of relation
821
+             * @param  string|array $options      the model and primary key values
822
+             * @param  object|array $row          the row to update
823
+             * @param  string $type the type can be "manyToOne", "oneToMany"
824
+             * 
825
+             * @return array|object the final row values
826
+             */
827 827
         protected function relateOneToManyAndManyToOne($relationship, $options, $row, $type){
828 828
             if (in_array($relationship, $this->withs)) {
829 829
                 get_instance()->loader->model($options['model'], $relationship . '_model');
Please login to merge, or discard this patch.
core/libraries/Pagination.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -225,15 +225,15 @@
 block discarded – undo
225 225
                 }
226 226
             }
227 227
             $navbar .= $this->config['next_open'] . '<a href="' . $query . ($currentPageNumber + 1) . '">' 
228
-                       . $this->config['next_text'] . '</a>' . $this->config['next_close'];
228
+                        . $this->config['next_text'] . '</a>' . $this->config['next_close'];
229 229
             return $navbar;
230 230
         }
231 231
 
232 232
 
233
-         /**
234
-         * Build the pagination link for the first page
235
-         * @see Pagination::buildPaginationLinkForFirstAndLastPage
236
-         */
233
+            /**
234
+             * Build the pagination link for the first page
235
+             * @see Pagination::buildPaginationLinkForFirstAndLastPage
236
+             */
237 237
         protected function buildPaginationLinkForFirstPage($begin, $end, $currentPageNumber) {
238 238
             return $this->buildPaginationLinkForFirstAndLastPage($begin, $end, $currentPageNumber, 'first');
239 239
         }
Please login to merge, or discard this patch.
core/libraries/FormValidation.php 1 patch
Indentation   +203 added lines, -203 removed lines patch added patch discarded remove patch
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
             }
125 125
         }
126 126
 
127
-         /**
128
-         * Reset the form validation instance
129
-         *
130
-         * @return object the current instance
131
-         */
127
+            /**
128
+             * Reset the form validation instance
129
+             *
130
+             * @return object the current instance
131
+             */
132 132
         public function reset() {
133 133
             $this->rules        = array();
134 134
             $this->labels       = array();
@@ -152,11 +152,11 @@  discard block
 block discarded – undo
152 152
             return $this;
153 153
         }
154 154
 
155
-         /**
156
-         * Return the validation data
157
-         * 
158
-         * @return array the validation data
159
-         */
155
+            /**
156
+             * Return the validation data
157
+             * 
158
+             * @return array the validation data
159
+             */
160 160
         public function getData() {
161 161
             return $this->data;
162 162
         }
@@ -205,11 +205,11 @@  discard block
 block discarded – undo
205 205
             return $this->rules;
206 206
         }
207 207
 
208
-         /**
209
-         * Return the list of the validations rules for the given field
210
-         * 
211
-         * @return array
212
-         */
208
+            /**
209
+             * Return the list of the validations rules for the given field
210
+             * 
211
+             * @return array
212
+             */
213 213
         public function getFieldRules($field) {
214 214
             $rules = array();
215 215
             if (array_key_exists($field, $this->rules)) {
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
          * @return string|null
226 226
          */
227 227
         public function getFieldValue($field) {
228
-             $value = null;
228
+                $value = null;
229 229
             if (array_key_exists($field, $this->data)) {
230 230
                 $value = $this->data[$field];
231 231
             }
@@ -247,15 +247,15 @@  discard block
 block discarded – undo
247 247
         }
248 248
             
249 249
         
250
-       /**
251
-        * Return the list of validation errors
252
-        * 
253
-        * @return array the errors list. 
254
-        * Format:
255
-        *  [field1] => 'error message 1', 
256
-        *  [field2] => 'error message 2' 
257
-        */
258
-       public function getErrors() {
250
+        /**
251
+         * Return the list of validation errors
252
+         * 
253
+         * @return array the errors list. 
254
+         * Format:
255
+         *  [field1] => 'error message 1', 
256
+         *  [field2] => 'error message 2' 
257
+         */
258
+        public function getErrors() {
259 259
             return $this->errors;
260 260
         }
261 261
 
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
          * @param string|null $field2     the second field used in some validation rule like "matches", "not_equal"
349 349
          *
350 350
          */
351
-         protected function setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue = null, $field2 = null) {
351
+            protected function setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue = null, $field2 = null) {
352 352
             //if the field is not required and his value is not set don't set error
353 353
             //but in case the field have value validate it
354 354
             if (!$this->fieldIsRequired($field) && strlen($value) <= 0) {
@@ -392,9 +392,9 @@  discard block
 block discarded – undo
392 392
          * @return string       the name of the validation method
393 393
          */
394 394
         protected function getRuleValidationMethod($rule) {
395
-             $parts = explode('_', $rule);
396
-             $parts = array_map('ucfirst', $parts);
397
-             return 'checkRule' . implode('', $parts);
395
+                $parts = explode('_', $rule);
396
+                $parts = array_map('ucfirst', $parts);
397
+                return 'checkRule' . implode('', $parts);
398 398
         }
399 399
         
400 400
         /**
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
         protected function filterValidationData() {
406 406
             foreach ($this->data as $key => $value ) {
407 407
                 if (is_string($value)) {
408
-                   $this->data[$key] = trim($value);
408
+                    $this->data[$key] = trim($value);
409 409
                 } else if(is_array($value)) {
410 410
                     $this->data[$key] = array_map('trim', $value);
411 411
                 }
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
                 $template['field2}']  = $field2;
453 453
                 $template['{value2}'] = $this->getFieldValue($field2);
454 454
                 $template['{label2}'] = $this->getFieldLabel($field2);
455
-             }     
455
+                }     
456 456
             $message = $this->messages[$rule];
457 457
             //Check for custom message
458 458
             if (isset($this->customErrors[$field][$rule])) {
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
                 //Get the name of the method to validate this rule
484 484
                 $method = $this->getRuleValidationMethod($realRuleName);
485 485
                 if (method_exists($this, $method)) {
486
-                       call_user_func_array(array($this, $method), array($field, $realRuleName, $paramValue));
486
+                        call_user_func_array(array($this, $method), array($field, $realRuleName, $paramValue));
487 487
                 } else {
488 488
                     $this->forceError = true;
489 489
                     show_error('Invalid validaton rule "' . $realRuleName . '"');
@@ -575,14 +575,14 @@  discard block
 block discarded – undo
575 575
          * @param  string|null  $paramValue  the rule parameter
576 576
          */ 
577 577
         protected function checkRuleMinLength($field, $rule, $paramValue) {
578
-           $value = $this->getFieldValue($field);  
579
-           $this->setSimpleFieldError(
580
-                                     strlen($value) < $paramValue, 
581
-                                     $field, 
582
-                                     $value, 
583
-                                     $rule, 
584
-                                     $paramValue
585
-                                 );
578
+            $value = $this->getFieldValue($field);  
579
+            $this->setSimpleFieldError(
580
+                                        strlen($value) < $paramValue, 
581
+                                        $field, 
582
+                                        $value, 
583
+                                        $rule, 
584
+                                        $paramValue
585
+                                    );
586 586
         }
587 587
 
588 588
         /**
@@ -593,14 +593,14 @@  discard block
 block discarded – undo
593 593
          * @param  string|null  $paramValue  the rule parameter
594 594
          */
595 595
         protected function checkRuleMaxLength($field, $rule, $paramValue) {
596
-           $value = $this->getFieldValue($field);
597
-           $this->setSimpleFieldError(
598
-                                     strlen($value) > $paramValue, 
599
-                                     $field, 
600
-                                     $value, 
601
-                                     $rule, 
602
-                                     $paramValue
603
-                                 );
596
+            $value = $this->getFieldValue($field);
597
+            $this->setSimpleFieldError(
598
+                                        strlen($value) > $paramValue, 
599
+                                        $field, 
600
+                                        $value, 
601
+                                        $rule, 
602
+                                        $paramValue
603
+                                    );
604 604
         }
605 605
 
606 606
         /**
@@ -611,14 +611,14 @@  discard block
 block discarded – undo
611 611
          * @param  string|null  $paramValue  the rule parameter
612 612
          */
613 613
         protected function checkRuleExactLength($field, $rule, $paramValue) {
614
-           $value = $this->getFieldValue($field);
615
-           $this->setSimpleFieldError(
616
-                                     strlen($value) != $paramValue, 
617
-                                     $field, 
618
-                                     $value, 
619
-                                     $rule, 
620
-                                     $paramValue
621
-                                 );
614
+            $value = $this->getFieldValue($field);
615
+            $this->setSimpleFieldError(
616
+                                        strlen($value) != $paramValue, 
617
+                                        $field, 
618
+                                        $value, 
619
+                                        $rule, 
620
+                                        $paramValue
621
+                                    );
622 622
         }
623 623
 
624 624
         /**
@@ -631,13 +631,13 @@  discard block
 block discarded – undo
631 631
         protected function checkRuleMatches($field, $rule, $paramValue) {
632 632
             $value = $this->getFieldValue($field);    
633 633
             $this->setSimpleFieldError(
634
-                                     $value != $this->getFieldValue($paramValue), 
635
-                                     $field, 
636
-                                     $value, 
637
-                                     $rule, 
638
-                                     $paramValue,
639
-                                     $paramValue //field2
640
-                                 );
634
+                                        $value != $this->getFieldValue($paramValue), 
635
+                                        $field, 
636
+                                        $value, 
637
+                                        $rule, 
638
+                                        $paramValue,
639
+                                        $paramValue //field2
640
+                                    );
641 641
         }
642 642
 
643 643
         /**
@@ -650,13 +650,13 @@  discard block
 block discarded – undo
650 650
         protected function checkRuleNotEqual($field, $rule, $paramValue) {
651 651
             $value = $this->getFieldValue($field);    
652 652
             $this->setSimpleFieldError(
653
-                                     $value == $this->getFieldValue($paramValue), 
654
-                                     $field, 
655
-                                     $value, 
656
-                                     $rule, 
657
-                                     $paramValue,
658
-                                     $paramValue //field2
659
-                                 );
653
+                                        $value == $this->getFieldValue($paramValue), 
654
+                                        $field, 
655
+                                        $value, 
656
+                                        $rule, 
657
+                                        $paramValue,
658
+                                        $paramValue //field2
659
+                                    );
660 660
         }
661 661
 
662 662
         /**
@@ -669,12 +669,12 @@  discard block
 block discarded – undo
669 669
         protected function checkRuleMin($field, $rule, $paramValue) {
670 670
             $value = $this->getFieldValue($field);  
671 671
             $this->setSimpleFieldError(
672
-                                 $value < $paramValue, 
673
-                                 $field, 
674
-                                 $value, 
675
-                                 $rule, 
676
-                                 $paramValue
677
-                             );
672
+                                    $value < $paramValue, 
673
+                                    $field, 
674
+                                    $value, 
675
+                                    $rule, 
676
+                                    $paramValue
677
+                                );
678 678
         }
679 679
 
680 680
         /**
@@ -687,12 +687,12 @@  discard block
 block discarded – undo
687 687
         protected function checkRuleMax($field, $rule, $paramValue) {
688 688
             $value = $this->getFieldValue($field); 
689 689
             $this->setSimpleFieldError(
690
-                                 $value > $paramValue, 
691
-                                 $field, 
692
-                                 $value, 
693
-                                 $rule, 
694
-                                 $paramValue
695
-                             );
690
+                                    $value > $paramValue, 
691
+                                    $field, 
692
+                                    $value, 
693
+                                    $rule, 
694
+                                    $paramValue
695
+                                );
696 696
         }
697 697
 
698 698
         /**
@@ -708,12 +708,12 @@  discard block
 block discarded – undo
708 708
             $betweens = explode(',', $paramValue, 2);
709 709
             $betweens = array_map('trim', $betweens);
710 710
             $this->setSimpleFieldError(
711
-                                 ($value < $betweens[0]) || ($value > $betweens[1]), 
712
-                                 $field, 
713
-                                 $value, 
714
-                                 $rule, 
715
-                                 $paramValue
716
-                             );
711
+                                    ($value < $betweens[0]) || ($value > $betweens[1]), 
712
+                                    $field, 
713
+                                    $value, 
714
+                                    $rule, 
715
+                                    $paramValue
716
+                                );
717 717
         }
718 718
 
719 719
         /**
@@ -730,12 +730,12 @@  discard block
 block discarded – undo
730 730
             $list = array_map('trim', $list);
731 731
             $paramValue = implode(',', $list);
732 732
             $this->setSimpleFieldError(
733
-                                 !in_array($value, $list), 
734
-                                 $field, 
735
-                                 $value, 
736
-                                 $rule, 
737
-                                 $paramValue
738
-                             ); 
733
+                                    !in_array($value, $list), 
734
+                                    $field, 
735
+                                    $value, 
736
+                                    $rule, 
737
+                                    $paramValue
738
+                                ); 
739 739
         }
740 740
 
741 741
         /**
@@ -748,12 +748,12 @@  discard block
 block discarded – undo
748 748
         protected function checkRuleNumeric($field, $rule, $paramValue) {
749 749
             $value = $this->getFieldValue($field);    
750 750
             $this->setSimpleFieldError(
751
-                                 !is_numeric($value), 
752
-                                 $field, 
753
-                                 $value, 
754
-                                 $rule, 
755
-                                 $paramValue
756
-                             );
751
+                                    !is_numeric($value), 
752
+                                    $field, 
753
+                                    $value, 
754
+                                    $rule, 
755
+                                    $paramValue
756
+                                );
757 757
         }
758 758
 
759 759
         /**
@@ -765,13 +765,13 @@  discard block
 block discarded – undo
765 765
          */
766 766
         protected function checkRuleInteger($field, $rule, $paramValue) {
767 767
             $value = $this->getFieldValue($field);  
768
-             $this->setSimpleFieldError(
769
-                                 filter_var($value, FILTER_VALIDATE_INT) === false, 
770
-                                 $field, 
771
-                                 $value, 
772
-                                 $rule, 
773
-                                 $paramValue
774
-                             );
768
+                $this->setSimpleFieldError(
769
+                                    filter_var($value, FILTER_VALIDATE_INT) === false, 
770
+                                    $field, 
771
+                                    $value, 
772
+                                    $rule, 
773
+                                    $paramValue
774
+                                );
775 775
         }
776 776
 
777 777
         /**
@@ -784,12 +784,12 @@  discard block
 block discarded – undo
784 784
         protected function checkRuleIntegerNatural($field, $rule, $paramValue) {
785 785
             $value = $this->getFieldValue($field);
786 786
             $this->setSimpleFieldError(
787
-                                 filter_var($value, FILTER_VALIDATE_INT) === false || $value < 0, 
788
-                                 $field, 
789
-                                 $value, 
790
-                                 $rule, 
791
-                                 $paramValue
792
-                             );
787
+                                    filter_var($value, FILTER_VALIDATE_INT) === false || $value < 0, 
788
+                                    $field, 
789
+                                    $value, 
790
+                                    $rule, 
791
+                                    $paramValue
792
+                                );
793 793
         }
794 794
 
795 795
         /**
@@ -802,12 +802,12 @@  discard block
 block discarded – undo
802 802
         protected function checkRuleAlpha($field, $rule, $paramValue) {
803 803
             $value = $this->getFieldValue($field);
804 804
             $this->setSimpleFieldError(
805
-                                 !preg_match('/^[\pL\pM\s]+$/u', $value), 
806
-                                 $field, 
807
-                                 $value, 
808
-                                 $rule, 
809
-                                 $paramValue
810
-                             );
805
+                                    !preg_match('/^[\pL\pM\s]+$/u', $value), 
806
+                                    $field, 
807
+                                    $value, 
808
+                                    $rule, 
809
+                                    $paramValue
810
+                                );
811 811
         }
812 812
 
813 813
         /**
@@ -820,12 +820,12 @@  discard block
 block discarded – undo
820 820
         protected function checkRuleAlphaDash($field, $rule, $paramValue) {
821 821
             $value = $this->getFieldValue($field);
822 822
             $this->setSimpleFieldError(
823
-                                 !preg_match('/^[\pL\pM_-]+$/u', $value), 
824
-                                 $field, 
825
-                                 $value, 
826
-                                 $rule, 
827
-                                 $paramValue
828
-                             );
823
+                                    !preg_match('/^[\pL\pM_-]+$/u', $value), 
824
+                                    $field, 
825
+                                    $value, 
826
+                                    $rule, 
827
+                                    $paramValue
828
+                                );
829 829
         }
830 830
 
831 831
         /**
@@ -838,12 +838,12 @@  discard block
 block discarded – undo
838 838
         protected function checkRuleAlnum($field, $rule, $paramValue) {
839 839
             $value = $this->getFieldValue($field);
840 840
             $this->setSimpleFieldError(
841
-                                 !preg_match('/^[\pL\pM\pN\s]+$/u', $value), 
842
-                                 $field, 
843
-                                 $value, 
844
-                                 $rule, 
845
-                                 $paramValue
846
-                             );
841
+                                    !preg_match('/^[\pL\pM\pN\s]+$/u', $value), 
842
+                                    $field, 
843
+                                    $value, 
844
+                                    $rule, 
845
+                                    $paramValue
846
+                                );
847 847
         }
848 848
 
849 849
         /**
@@ -856,12 +856,12 @@  discard block
 block discarded – undo
856 856
         protected function checkRuleAlnumDash($field, $rule, $paramValue) {
857 857
             $value = $this->getFieldValue($field);
858 858
             $this->setSimpleFieldError(
859
-                                 !preg_match('/^[\pL\pM\pN_-]+$/u', $value), 
860
-                                 $field, 
861
-                                 $value, 
862
-                                 $rule, 
863
-                                 $paramValue
864
-                             );
859
+                                    !preg_match('/^[\pL\pM\pN_-]+$/u', $value), 
860
+                                    $field, 
861
+                                    $value, 
862
+                                    $rule, 
863
+                                    $paramValue
864
+                                );
865 865
         }
866 866
 
867 867
         /**
@@ -874,12 +874,12 @@  discard block
 block discarded – undo
874 874
         protected function checkRuleEmail($field, $rule, $paramValue) {
875 875
             $value = $this->getFieldValue($field); 
876 876
             $this->setSimpleFieldError(
877
-                                 filter_var($value, FILTER_VALIDATE_EMAIL) === false, 
878
-                                 $field, 
879
-                                 $value, 
880
-                                 $rule, 
881
-                                 $paramValue
882
-                             );
877
+                                    filter_var($value, FILTER_VALIDATE_EMAIL) === false, 
878
+                                    $field, 
879
+                                    $value, 
880
+                                    $rule, 
881
+                                    $paramValue
882
+                                );
883 883
         }
884 884
 
885 885
         /**
@@ -895,12 +895,12 @@  discard block
 block discarded – undo
895 895
             $format = $paramValue;
896 896
             $dateValue = date_create_from_format($format, $value);  
897 897
             $this->setSimpleFieldError(
898
-                                 $dateValue === false || $dateValue->format($format) !== $value, 
899
-                                 $field, 
900
-                                 $value, 
901
-                                 $rule, 
902
-                                 $paramValue
903
-                             );
898
+                                    $dateValue === false || $dateValue->format($format) !== $value, 
899
+                                    $field, 
900
+                                    $value, 
901
+                                    $rule, 
902
+                                    $paramValue
903
+                                );
904 904
         }
905 905
 
906 906
         /**
@@ -913,13 +913,13 @@  discard block
 block discarded – undo
913 913
          */
914 914
         protected function checkRuleDateBefore($field, $rule, $paramValue) {
915 915
             $value = $this->getFieldValue($field);
916
-             $this->setSimpleFieldError(
917
-                                 strtotime($value) >= strtotime($paramValue), 
918
-                                 $field, 
919
-                                 $value, 
920
-                                 $rule, 
921
-                                 $paramValue
922
-                             );
916
+                $this->setSimpleFieldError(
917
+                                    strtotime($value) >= strtotime($paramValue), 
918
+                                    $field, 
919
+                                    $value, 
920
+                                    $rule, 
921
+                                    $paramValue
922
+                                );
923 923
         }
924 924
 
925 925
         /**
@@ -933,12 +933,12 @@  discard block
 block discarded – undo
933 933
         protected function checkRuleDateAfter($field, $rule, $paramValue) {
934 934
             $value = $this->getFieldValue($field);
935 935
             $this->setSimpleFieldError(
936
-                                 strtotime($value) <= strtotime($paramValue), 
937
-                                 $field, 
938
-                                 $value, 
939
-                                 $rule, 
940
-                                 $paramValue
941
-                             );
936
+                                    strtotime($value) <= strtotime($paramValue), 
937
+                                    $field, 
938
+                                    $value, 
939
+                                    $rule, 
940
+                                    $paramValue
941
+                                );
942 942
         }
943 943
 
944 944
         /**
@@ -951,12 +951,12 @@  discard block
 block discarded – undo
951 951
         protected function checkRuleUrl($field, $rule, $paramValue) {
952 952
             $value = $this->getFieldValue($field);
953 953
             $this->setSimpleFieldError(
954
-                                 filter_var($value, FILTER_VALIDATE_URL) === false, 
955
-                                 $field, 
956
-                                 $value, 
957
-                                 $rule, 
958
-                                 $paramValue
959
-                             );
954
+                                    filter_var($value, FILTER_VALIDATE_URL) === false, 
955
+                                    $field, 
956
+                                    $value, 
957
+                                    $rule, 
958
+                                    $paramValue
959
+                                );
960 960
         }
961 961
 
962 962
         /**
@@ -970,12 +970,12 @@  discard block
 block discarded – undo
970 970
         protected function checkRuleIp($field, $rule, $paramValue) {
971 971
             $value = $this->getFieldValue($field);   
972 972
             $this->setSimpleFieldError(
973
-                                 filter_var($value, FILTER_VALIDATE_IP) === false, 
974
-                                 $field, 
975
-                                 $value, 
976
-                                 $rule, 
977
-                                 $paramValue
978
-                             );
973
+                                    filter_var($value, FILTER_VALIDATE_IP) === false, 
974
+                                    $field, 
975
+                                    $value, 
976
+                                    $rule, 
977
+                                    $paramValue
978
+                                );
979 979
         }
980 980
 
981 981
         /**
@@ -988,12 +988,12 @@  discard block
 block discarded – undo
988 988
         protected function checkRuleIpv4($field, $rule, $paramValue) {
989 989
             $value = $this->getFieldValue($field);  
990 990
             $this->setSimpleFieldError(
991
-                                 filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false, 
992
-                                 $field, 
993
-                                 $value, 
994
-                                 $rule, 
995
-                                 $paramValue
996
-                             );
991
+                                    filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false, 
992
+                                    $field, 
993
+                                    $value, 
994
+                                    $rule, 
995
+                                    $paramValue
996
+                                );
997 997
         }
998 998
 
999 999
         /**
@@ -1006,12 +1006,12 @@  discard block
 block discarded – undo
1006 1006
         protected function checkRuleIpv6($field, $rule, $paramValue) {
1007 1007
             $value = $this->getFieldValue($field);   
1008 1008
             $this->setSimpleFieldError(
1009
-                                 filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false, 
1010
-                                 $field, 
1011
-                                 $value, 
1012
-                                 $rule, 
1013
-                                 $paramValue
1014
-                             );
1009
+                                    filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false, 
1010
+                                    $field, 
1011
+                                    $value, 
1012
+                                    $rule, 
1013
+                                    $paramValue
1014
+                                );
1015 1015
         }
1016 1016
 
1017 1017
         /**
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
             $value = $this->getFieldValue($field);    
1031 1031
             list($table, $column) = explode('.', $paramValue);
1032 1032
             $obj->database->getQueryBuilder()->from($table)
1033
-                                              ->where($column, $value);
1033
+                                                ->where($column, $value);
1034 1034
             $obj->database->get();
1035 1035
             if ($obj->database->numRows() > 0) {
1036 1036
                 $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue);
@@ -1055,8 +1055,8 @@  discard block
 block discarded – undo
1055 1055
             list($table, $column) = explode('.', $data[0]);
1056 1056
             list($columnKey, $valueKey) = explode('=', $data[1]);
1057 1057
             $obj->database->getQueryBuilder()->from($table)
1058
-                                              ->where($column, $value)
1059
-                                              ->where($columnKey, '!=', trim($valueKey));
1058
+                                                ->where($column, $value)
1059
+                                                ->where($columnKey, '!=', trim($valueKey));
1060 1060
             $obj->database->get();
1061 1061
             if ($obj->database->numRows() > 0) {
1062 1062
                 $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue);
@@ -1079,7 +1079,7 @@  discard block
 block discarded – undo
1079 1079
             $value = $this->getFieldValue($field);    
1080 1080
             list($table, $column) = explode('.', $paramValue);
1081 1081
             $obj->database->getQueryBuilder()->from($table)
1082
-                                              ->where($column, $value);
1082
+                                                ->where($column, $value);
1083 1083
             $obj->database->get();
1084 1084
             if ($obj->database->numRows() <= 0) {
1085 1085
                 $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue);
@@ -1096,13 +1096,13 @@  discard block
 block discarded – undo
1096 1096
          */
1097 1097
         protected function checkRuleRegex($field, $rule, $paramValue) {
1098 1098
             $value = $this->getFieldValue($field);
1099
-             $this->setSimpleFieldError(
1100
-                                 !preg_match($paramValue, $value), 
1101
-                                 $field, 
1102
-                                 $value, 
1103
-                                 $rule, 
1104
-                                 $paramValue
1105
-                             );       
1099
+                $this->setSimpleFieldError(
1100
+                                    !preg_match($paramValue, $value), 
1101
+                                    $field, 
1102
+                                    $value, 
1103
+                                    $rule, 
1104
+                                    $paramValue
1105
+                                );       
1106 1106
         }
1107 1107
 
1108 1108
         /**
@@ -1124,12 +1124,12 @@  discard block
 block discarded – undo
1124 1124
             $value = $this->getFieldValue($field);    
1125 1125
             if (is_callable($paramValue)) {
1126 1126
                 $this->setSimpleFieldError(
1127
-                                 call_user_func_array($paramValue, array($value)) === false, 
1128
-                                 $field, 
1129
-                                 $value, 
1130
-                                 $rule, 
1131
-                                 $paramValue
1132
-                             ); 
1127
+                                    call_user_func_array($paramValue, array($value)) === false, 
1128
+                                    $field, 
1129
+                                    $value, 
1130
+                                    $rule, 
1131
+                                    $paramValue
1132
+                                ); 
1133 1133
             } else{
1134 1134
                 $this->forceError = true;
1135 1135
                 show_error('The callback validation function/method "' . $paramValue . '" does not exist');
Please login to merge, or discard this patch.
core/libraries/Upload.php 2 patches
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -316,15 +316,15 @@  discard block
 block discarded – undo
316 316
             return $this;
317 317
         }
318 318
 
319
-         /**
320
-         *    Append a mime type to allowed mime types
321
-         *
322
-         *    @since     1.0
323
-         *    @version   1.0.1
324
-         *    @param     string      $mime
325
-         *    @return    object
326
-         *    @method    boolean     setAllowMimeType
327
-         */
319
+            /**
320
+             *    Append a mime type to allowed mime types
321
+             *
322
+             *    @since     1.0
323
+             *    @version   1.0.1
324
+             *    @param     string      $mime
325
+             *    @return    object
326
+             *    @method    boolean     setAllowMimeType
327
+             */
328 328
         public function setAllowMimeType($mime) {
329 329
             $this->allowedMimeTypes[] = strtolower($mime);
330 330
             $this->file['allowed_mime_types'][] = strtolower($mime); 
@@ -438,10 +438,10 @@  discard block
 block discarded – undo
438 438
             return $this;
439 439
         }
440 440
 
441
-         /**
442
-         *    Get the allow overwriting
443
-         *    @return    boolean
444
-         */
441
+            /**
442
+             *    Get the allow overwriting
443
+             *    @return    boolean
444
+             */
445 445
         public function isAllowOverwriting() {
446 446
             return $this->overwriteFile ;
447 447
         }
@@ -532,14 +532,14 @@  discard block
 block discarded – undo
532 532
             return $this->error;
533 533
         }
534 534
 
535
-         /**
536
-         *    Retrive status of upload
537
-         *
538
-         *    @since     1.0
539
-         *    @version   1.0
540
-         *    @return    boolean
541
-         *    @method    boolean    getStatus
542
-         */
535
+            /**
536
+             *    Retrive status of upload
537
+             *
538
+             *    @since     1.0
539
+             *    @version   1.0
540
+             *    @return    boolean
541
+             *    @method    boolean    getStatus
542
+             */
543 543
         public function getStatus() {
544 544
             return $this->file['status'];
545 545
         }
@@ -572,11 +572,11 @@  discard block
 block discarded – undo
572 572
                                 && is_file($file);
573 573
         }
574 574
 
575
-         /**
576
-         * Set the filename if is empty using the uploaded data information
577
-         *
578
-         * @return object the current instance
579
-         */
575
+            /**
576
+             * Set the filename if is empty using the uploaded data information
577
+             *
578
+             * @return object the current instance
579
+             */
580 580
         protected function setFilenameUsingUploadedData() {
581 581
             // set original filename if not have a new name
582 582
             if (empty($this->filename)) {
@@ -660,12 +660,12 @@  discard block
 block discarded – undo
660 660
             return $this->maxFileSize >= $size;
661 661
         }
662 662
 
663
-         /**
664
-         *    Check the file overwritting
665
-         *    @since     1.0
666
-         *    @version   1.0
667
-         *    @return    boolean
668
-         */
663
+            /**
664
+             *    Check the file overwritting
665
+             *    @since     1.0
666
+             *    @version   1.0
667
+             *    @return    boolean
668
+             */
669 669
         protected function checkFileOverwritting() {
670 670
             if ($this->fileExists($this->destinationDirectory . $this->filename)) {
671 671
                 return $this->overwriteFile;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -443,7 +443,7 @@
 block discarded – undo
443 443
          *    @return    boolean
444 444
          */
445 445
         public function isAllowOverwriting() {
446
-            return $this->overwriteFile ;
446
+            return $this->overwriteFile;
447 447
         }
448 448
 
449 449
         /**
Please login to merge, or discard this patch.
core/libraries/Email.php 2 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
             $addresses = array();
348 348
             foreach ($pairs as $name => $email) {
349 349
                 if (is_numeric($name)) {
350
-                   $name = null;
350
+                    $name = null;
351 351
                 }
352 352
                 $addresses[] = $this->formatHeader($email, $name);
353 353
             }
@@ -738,10 +738,10 @@  discard block
 block discarded – undo
738 738
             return $headers;
739 739
         }
740 740
 
741
-         /**
742
-         * Get the attachment message for send or the simple message
743
-         * @return string
744
-         */
741
+            /**
742
+             * Get the attachment message for send or the simple message
743
+             * @return string
744
+             */
745 745
         protected function getMessageWithAttachmentForSend() {
746 746
             $message = wordwrap($this->message, $this->wrap);
747 747
             if ($this->hasAttachments()) {
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
          */
772 772
         protected function sendHelloCommand() {
773 773
             $responseCode = $this->sendCommand('EHLO ' . $this->getSmtpClientHostname())
774
-                                 ->getSmtpResponseCode();
774
+                                    ->getSmtpResponseCode();
775 775
             if ($responseCode !== 250) {
776 776
                 $this->error = $this->smtpResponse;
777 777
                 return false;
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
             $message = $this->getMessageWithAttachmentForSend();
919 919
             $headers = $this->getHeadersForSend(); 
920 920
             $this->logger->info('Sending new mail using mail protocol, the information are listed below: '
921
-                                  . 'destination: ' . $to . ', headers: ' . $headers . ', message: ' . $message);
921
+                                    . 'destination: ' . $to . ', headers: ' . $headers . ', message: ' . $message);
922 922
             $result = mail($to, $this->subject, $message, $headers, $this->params);
923 923
             if (!$result) {
924 924
                 $this->error = 'Error when sending mail using mail protocol';
@@ -926,10 +926,10 @@  discard block
 block discarded – undo
926 926
             return $result;
927 927
         }
928 928
 
929
-         /**
930
-         * Send mail using "smtp" protocol
931
-         * @return boolean
932
-         */
929
+            /**
930
+             * Send mail using "smtp" protocol
931
+             * @return boolean
932
+             */
933 933
         protected function sendSmtp() {
934 934
             if (!$this->smtpConnection()) {
935 935
                 return false;
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
             $message = $this->getMessageWithAttachmentForSend();
940 940
             $headers = $this->getHeadersForSend();
941 941
             $this->logger->info('Sending new mail using SMTP protocol, the information are listed below: '
942
-                                  . 'destination: ' . $to . ', headers: ' . $headers . ', message: ' . $message);
942
+                                    . 'destination: ' . $to . ', headers: ' . $headers . ', message: ' . $message);
943 943
             $recipients = array_merge($this->to, $this->cc, $this->bcc);
944 944
             $commands = array(
945 945
                                 'mail_from' => array('MAIL FROM: <' . $this->from . '>', 'MAIL_FROM', 250),
@@ -990,17 +990,17 @@  discard block
 block discarded – undo
990 990
         }
991 991
 
992 992
 
993
-         /**
994
-         * Return the client hostname for SMTP
995
-         * 
996
-         * There are only two legal types of hostname - either a fully
997
-         * qualified domain name (eg: "mail.example.com") or an IP literal
998
-         * (eg: "[1.2.3.4]").
999
-         *
1000
-         * @link    https://tools.ietf.org/html/rfc5321#section-2.3.5
1001
-         * @link    http://cbl.abuseat.org/namingproblems.html
1002
-         * @return string
1003
-         */
993
+            /**
994
+             * Return the client hostname for SMTP
995
+             * 
996
+             * There are only two legal types of hostname - either a fully
997
+             * qualified domain name (eg: "mail.example.com") or an IP literal
998
+             * (eg: "[1.2.3.4]").
999
+             *
1000
+             * @link    https://tools.ietf.org/html/rfc5321#section-2.3.5
1001
+             * @link    http://cbl.abuseat.org/namingproblems.html
1002
+             * @return string
1003
+             */
1004 1004
         protected function getSmtpClientHostname() {
1005 1005
             $globals = &class_loader('GlobalVar', 'classes');
1006 1006
             if ($globals->server('SERVER_NAME')) {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      * SOFTWARE.
29 29
      */
30 30
 
31
-    class Email extends BaseClass{
31
+    class Email extends BaseClass {
32 32
         /**
33 33
          * @var int $wrap
34 34
          */
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
             $message = wordwrap($this->message, $this->wrap);
747 747
             if ($this->hasAttachments()) {
748 748
                 $this->setAttachmentHeaders();
749
-                $message  = $this->assembleAttachmentBody();
749
+                $message = $this->assembleAttachmentBody();
750 750
             }
751 751
             return $message;
752 752
         }
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
                                         $this->smtpConfig['connection_timeout']
827 827
                                     );
828 828
 
829
-            if (! is_resource($this->smtpSocket)) {
829
+            if (!is_resource($this->smtpSocket)) {
830 830
                 $this->error = $errorNumber . ': ' . $errorMessage;
831 831
                 return false;
832 832
             }
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
                      */
876 876
                     if (is_resource($this->smtpSocket)) {
877 877
                         $method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
878
-                        if(version_compare(PHP_VERSION, '5.6', '>=')) {
878
+                        if (version_compare(PHP_VERSION, '5.6', '>=')) {
879 879
                             $method = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
880 880
                         }
881 881
                         stream_socket_enable_crypto($this->smtpSocket, true, $method);
@@ -983,7 +983,7 @@  discard block
 block discarded – undo
983 983
                 'To' => $to
984 984
             );
985 985
             foreach ($additionalHeaders as $key => $value) {
986
-                if (! isset($this->headers[$key])) {
986
+                if (!isset($this->headers[$key])) {
987 987
                     $this->headers[$key] = $value;
988 988
                 }
989 989
             }
Please login to merge, or discard this patch.