Passed
Push — develop ( f30815...940473 )
by Henry
03:36
created
src/Models/RecordValidator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
 
99 99
         // check validator
100 100
         if (!is_callable($validator)) {
101
-            throw new Exception('Validator for field ' . $options['id'] . ' is not callable');
101
+            throw new Exception('Validator for field '.$options['id'].' is not callable');
102 102
         }
103 103
 
104 104
 
Please login to merge, or discard this patch.
src/Helpers/JSONP.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
             throw new \Exception(json_last_error_msg());
12 12
         }
13 13
         header('Content-type: application/javascript; charset=utf-8', true);
14
-        echo 'var data = ' . $JSON;
14
+        echo 'var data = '.$JSON;
15 15
     }
16 16
     
17 17
     public static function translateAndRespond($data)
Please login to merge, or discard this patch.
src/Models/ActiveRecord.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,8 +84,8 @@
 block discarded – undo
84 84
     
85 85
     
86 86
     /**
87
-    * @var array $validators Validation checks
88
-    */
87
+     * @var array $validators Validation checks
88
+     */
89 89
     public static $validators = [];
90 90
 
91 91
     /**
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 
739 739
             // create new or update existing
740 740
             if ($this->_isPhantom) {
741
-                DB::nonQuery((new Insert())->setTable(static::$tableName)->set($set), null, [static::class,'handleException']);
741
+                DB::nonQuery((new Insert())->setTable(static::$tableName)->set($set), null, [static::class, 'handleException']);
742 742
                 $primaryKey = $this->getPrimaryKey();
743 743
                 $insertID = DB::insertID();
744 744
                 $fields = static::getClassFields();
@@ -751,8 +751,8 @@  discard block
 block discarded – undo
751 751
                 $this->_isNew = true;
752 752
             } elseif (count($set)) {
753 753
                 DB::nonQuery((new Update())->setTable(static::$tableName)->set($set)->where(
754
-                    sprintf('`%s` = %u', static::_cn($this->getPrimaryKey()), (string)$this->getPrimaryKeyValue())
755
-                ), null, [static::class,'handleException']);
754
+                    sprintf('`%s` = %u', static::_cn($this->getPrimaryKey()), (string) $this->getPrimaryKeyValue())
755
+                ), null, [static::class, 'handleException']);
756 756
 
757 757
                 $this->_isUpdated = true;
758 758
             }
@@ -784,11 +784,11 @@  discard block
 block discarded – undo
784 784
                 $recordValues = $this->_prepareRecordValues();
785 785
                 $set = static::_mapValuesToSet($recordValues);
786 786
 
787
-                DB::nonQuery((new Insert())->setTable(static::getHistoryTable())->set($set), null, [static::class,'handleException']);
787
+                DB::nonQuery((new Insert())->setTable(static::getHistoryTable())->set($set), null, [static::class, 'handleException']);
788 788
             }
789 789
         }
790 790
 
791
-        return static::delete((string)$this->getPrimaryKeyValue());
791
+        return static::delete((string) $this->getPrimaryKeyValue());
792 792
     }
793 793
 
794 794
     /**
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
      */
800 800
     public static function delete($id): bool
801 801
     {
802
-        DB::nonQuery((new Delete())->setTable(static::$tableName)->where(sprintf('`%s` = %u', static::_cn(static::$primaryKey ? static::$primaryKey : 'ID'), $id)), null, [static::class,'handleException']);
802
+        DB::nonQuery((new Delete())->setTable(static::$tableName)->where(sprintf('`%s` = %u', static::_cn(static::$primaryKey ? static::$primaryKey : 'ID'), $id)), null, [static::class, 'handleException']);
803 803
 
804 804
         return DB::affectedRows() > 0;
805 805
     }
@@ -852,7 +852,7 @@  discard block
 block discarded – undo
852 852
     {
853 853
         static::init();
854 854
         if (!static::fieldExists($field)) {
855
-            throw new Exception('getColumnName called on nonexisting column: ' . get_called_class().'->'.$field);
855
+            throw new Exception('getColumnName called on nonexisting column: '.get_called_class().'->'.$field);
856 856
         }
857 857
 
858 858
         return static::$_classFields[get_called_class()][$field]['columnName'];
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
             // clear buffer (required for the next query to work without running fetchAll first
1020 1020
             $Statement->closeCursor();
1021 1021
 
1022
-            return $Connection->query((string)$query); // now the query should finish with no error
1022
+            return $Connection->query((string) $query); // now the query should finish with no error
1023 1023
         } else {
1024 1024
             return DB::handleException($e, $query, $queryLog);
1025 1025
         }
@@ -1118,8 +1118,8 @@  discard block
 block discarded – undo
1118 1118
 
1119 1119
                     // skip these because they are built in
1120 1120
                     if (in_array($property->getName(), [
1121
-                        '_classFields','_classRelationships','_classBeforeSave','_classAfterSave','_fieldsDefined','_relationshipsDefined','_eventsDefined','_record','_validator'
1122
-                        ,'_validationErrors','_isDirty','_isValid','fieldSetMapper','_convertedValues','_originalValues','_isPhantom','_wasPhantom','_isNew','_isUpdated','_relatedObjects'
1121
+                        '_classFields', '_classRelationships', '_classBeforeSave', '_classAfterSave', '_fieldsDefined', '_relationshipsDefined', '_eventsDefined', '_record', '_validator'
1122
+                        ,'_validationErrors', '_isDirty', '_isValid', 'fieldSetMapper', '_convertedValues', '_originalValues', '_isPhantom', '_wasPhantom', '_isNew', '_isUpdated', '_relatedObjects'
1123 1123
                     ])) {
1124 1124
                         continue;
1125 1125
                     }
@@ -1313,7 +1313,7 @@  discard block
 block discarded – undo
1313 1313
                 case 'boolean':
1314 1314
                     {
1315 1315
                         if (!isset($this->_convertedValues[$field])) {
1316
-                            $this->_convertedValues[$field] = (bool)$value;
1316
+                            $this->_convertedValues[$field] = (bool) $value;
1317 1317
                         }
1318 1318
 
1319 1319
                         return $this->_convertedValues[$field];
@@ -1549,7 +1549,7 @@  discard block
 block discarded – undo
1549 1549
             foreach ($order as $key => $value) {
1550 1550
                 if (is_string($key)) {
1551 1551
                     $columnName = static::_cn($key);
1552
-                    $direction = strtoupper($value)=='DESC' ? 'DESC' : 'ASC';
1552
+                    $direction = strtoupper($value) == 'DESC' ? 'DESC' : 'ASC';
1553 1553
                 } else {
1554 1554
                     $columnName = static::_cn($value);
1555 1555
                     $direction = 'ASC';
Please login to merge, or discard this patch.
src/IO/Database/SQL.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
     public static function escape($str)
33 33
     {
34 34
         return str_replace(
35
-            ["\\",  "\x00", "\n",  "\r",  "'",  '"', "\x1a"],
36
-            ["\\\\","\\0","\\n", "\\r", "\'", '\"', "\\Z"],
35
+            ["\\", "\x00", "\n", "\r", "'", '"', "\x1a"],
36
+            ["\\\\", "\\0", "\\n", "\\r", "\'", '\"', "\\Z"],
37 37
             $str
38 38
         );
39 39
     }
@@ -210,10 +210,10 @@  discard block
 block discarded – undo
210 210
                 return 'year';
211 211
 
212 212
             case 'enum':
213
-                return sprintf('enum("%s")', join('","', array_map([static::class,'escape'], $field['values'])));
213
+                return sprintf('enum("%s")', join('","', array_map([static::class, 'escape'], $field['values'])));
214 214
 
215 215
             case 'set':
216
-                return sprintf('set("%s")', join('","', array_map([static::class,'escape'], $field['values'])));
216
+                return sprintf('set("%s")', join('","', array_map([static::class, 'escape'], $field['values'])));
217 217
 
218 218
             default:
219 219
                 throw new Exception("getSQLType: unhandled type $field[type]");
Please login to merge, or discard this patch.
src/Models/Auth/Session.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
             $Session->setFields($sessionData);
114 114
             if (function_exists('fastcgi_finish_request')) {
115 115
                 // @codeCoverageIgnoreStart
116
-                register_shutdown_function(function ($Session) {
116
+                register_shutdown_function(function($Session) {
117 117
                     $Session->save();
118 118
                 }, $Session);
119 119
             // @codeCoverageIgnoreEnd
Please login to merge, or discard this patch.
src/Models/Versioning.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@
 block discarded – undo
153 153
             // save a copy to history table
154 154
             $recordValues = $this->_prepareRecordValues();
155 155
             $set = static::_mapValuesToSet($recordValues);
156
-            DB::nonQuery((new Insert())->setTable(static::getHistoryTable())->set($set), null, [static::class,'handleError']);
156
+            DB::nonQuery((new Insert())->setTable(static::getHistoryTable())->set($set), null, [static::class, 'handleError']);
157 157
         }
158 158
     }
159 159
 }
Please login to merge, or discard this patch.
src/IO/Database/Query/Select.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 
52 52
     public function __toString(): string
53 53
     {
54
-        $expression = ($this->calcFoundRows ? 'SQL_CALC_FOUND_ROWS ' : '') . $this->expression;
54
+        $expression = ($this->calcFoundRows ? 'SQL_CALC_FOUND_ROWS ' : '').$this->expression;
55 55
 
56 56
         if (isset($this->tableAlias)) {
57 57
             $from = sprintf('`%s` AS `%s`', $this->table, $this->tableAlias);
Please login to merge, or discard this patch.
src/Models/SetMappers/DefaultSetMapper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,17 +29,17 @@
 block discarded – undo
29 29
 
30 30
     public function setBooleanValue($value): bool
31 31
     {
32
-        return (bool)$value;
32
+        return (bool) $value;
33 33
     }
34 34
 
35 35
     public function setDecimalValue($value): ?float
36 36
     {
37
-        return is_null($value) ? null : (float)preg_replace('/[^-\d.]/', '', $value);
37
+        return is_null($value) ? null : (float) preg_replace('/[^-\d.]/', '', $value);
38 38
     }
39 39
 
40 40
     public function setIntegerValue($value): ?int
41 41
     {
42
-        return is_null($value) ? null : (int)preg_replace('/[^-\d]/', '', $value);
42
+        return is_null($value) ? null : (int) preg_replace('/[^-\d]/', '', $value);
43 43
     }
44 44
 
45 45
     public function setTimestampValue($value): ?string
Please login to merge, or discard this patch.
config/app.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,6 +10,6 @@
 block discarded – undo
10 10
 use Divergence\App as App;
11 11
 
12 12
 return [
13
-    'debug'			=>	file_exists(App::$App->ApplicationPath . '/.debug'),
14
-    'environment'	=>	(file_exists(App::$App->ApplicationPath . '/.dev') ? 'dev' : 'production'),
13
+    'debug'			=>	file_exists(App::$App->ApplicationPath.'/.debug'),
14
+    'environment'	=>	(file_exists(App::$App->ApplicationPath.'/.dev') ? 'dev' : 'production'),
15 15
 ];
Please login to merge, or discard this patch.