Passed
Push — develop ( 9c2569...4e2a5f )
by Henry
01:53
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/Models/Relations.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         
69 69
         if ($options['type'] == 'one-one') {
70 70
             if (empty($options['local'])) {
71
-                $options['local'] = $relationship . 'ID';
71
+                $options['local'] = $relationship.'ID';
72 72
             }
73 73
                 
74 74
             if (empty($options['foreign'])) {
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
             }
81 81
                     
82 82
             if (empty($options['foreign'])) {
83
-                $options['foreign'] =  $classShortName. 'ID';
83
+                $options['foreign'] = $classShortName.'ID';
84 84
             }
85 85
                 
86 86
             if (!isset($options['indexField'])) {
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
             }
143 143
                 
144 144
             if (empty($options['linkLocal'])) {
145
-                $options['linkLocal'] = $classShortName . 'ID';
145
+                $options['linkLocal'] = $classShortName.'ID';
146 146
             }
147 147
         
148 148
             if (empty($options['linkForeign'])) {
149 149
                 $foreignShortname = basename(str_replace('\\', '/', $options['class']::$rootClass));
150
-                $options['linkForeign'] =  $foreignShortname . 'ID';
150
+                $options['linkForeign'] = $foreignShortname.'ID';
151 151
             }
152 152
         
153 153
             if (empty($options['local'])) {
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
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
         ];
67 67
         
68 68
         if ($options['order']) {
69
-            $query .= ' ORDER BY ' . join(',', static::_mapFieldOrder($options['order']));
69
+            $query .= ' ORDER BY '.join(',', static::_mapFieldOrder($options['order']));
70 70
         }
71 71
         
72 72
         if ($options['limit']) {
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   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
                         static::$tableName,
724 724
                         join(',', $set),
725 725
                     ],
726
-                    [static::class,'handleError']
726
+                    [static::class, 'handleError']
727 727
                 );
728 728
                 $this->_record[static::$primaryKey ? static::$primaryKey : 'ID'] = DB::insertID();
729 729
                 $this->_isPhantom = false;
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
                         static::_cn(static::$primaryKey ? static::$primaryKey : 'ID'),
738 738
                         $this->getPrimaryKeyValue(),
739 739
                     ],
740
-                    [static::class,'handleError']
740
+                    [static::class, 'handleError']
741 741
                 );
742 742
 
743 743
                 $this->_isUpdated = true;
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
             static::$tableName,
796 796
             static::_cn(static::$primaryKey ? static::$primaryKey : 'ID'),
797 797
             $id,
798
-        ], [static::class,'handleError']);
798
+        ], [static::class, 'handleError']);
799 799
 
800 800
         return DB::affectedRows() > 0;
801 801
     }
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
                     return ', '.$value.' AS '.$key;
815 815
                 }
816 816
             } else {
817
-                return ', ' . $columns;
817
+                return ', '.$columns;
818 818
             }
819 819
         }
820 820
     }
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
     public static function buildHaving($having)
829 829
     {
830 830
         if (!empty($having)) {
831
-            return ' HAVING (' . (is_array($having) ? join(') AND (', static::_mapConditions($having)) : $having) . ')';
831
+            return ' HAVING ('.(is_array($having) ? join(') AND (', static::_mapConditions($having)) : $having).')';
832 832
         }
833 833
     }
834 834
 
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
     {
892 892
         static::init();
893 893
         if (!static::fieldExists($field)) {
894
-            throw new Exception('getColumnName called on nonexisting column: ' . get_called_class().'->'.$field);
894
+            throw new Exception('getColumnName called on nonexisting column: '.get_called_class().'->'.$field);
895 895
         }
896 896
 
897 897
         return static::$_classFields[get_called_class()][$field]['columnName'];
@@ -1296,7 +1296,7 @@  discard block
 block discarded – undo
1296 1296
                 case 'boolean':
1297 1297
                 {
1298 1298
                     if (!isset($this->_convertedValues[$field])) {
1299
-                        $this->_convertedValues[$field] = (boolean)$value;
1299
+                        $this->_convertedValues[$field] = (boolean) $value;
1300 1300
                     }
1301 1301
 
1302 1302
                     return $this->_convertedValues[$field];
@@ -1524,7 +1524,7 @@  discard block
 block discarded – undo
1524 1524
             foreach ($order as $key => $value) {
1525 1525
                 if (is_string($key)) {
1526 1526
                     $columnName = static::_cn($key);
1527
-                    $direction = strtoupper($value)=='DESC' ? 'DESC' : 'ASC';
1527
+                    $direction = strtoupper($value) == 'DESC' ? 'DESC' : 'ASC';
1528 1528
                 } else {
1529 1529
                     $columnName = static::_cn($value);
1530 1530
                     $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/Media/Audio.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
         $PreviewMedia = Media::createFromFile($previewPath, [
91 91
             'ContextClass' => 'Media'
92 92
             ,'ContextID' => $this->ID
93
-            ,'Caption' => sprintf('%u sec preview (%us-%us)', static::$previewDuration, $startTime, $startTime+static::$previewDuration),
93
+            ,'Caption' => sprintf('%u sec preview (%us-%us)', static::$previewDuration, $startTime, $startTime + static::$previewDuration),
94 94
         ]);
95 95
 
96 96
         return $PreviewMedia;
Please login to merge, or discard this patch.
src/Models/Media/Video.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         }
117 117
 
118 118
         // extract video streams
119
-        $videoStreams = array_filter($output['streams'], function ($streamInfo) {
119
+        $videoStreams = array_filter($output['streams'], function($streamInfo) {
120 120
             return $streamInfo['codec_type'] == 'video';
121 121
         });
122 122
 
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
         $mediaInfo['streams'] = $output['streams'];
129 129
         $mediaInfo['videoStream'] = array_shift($videoStreams);
130 130
 
131
-        $mediaInfo['width'] = (int)$mediaInfo['videoStream']['width'];
132
-        $mediaInfo['height'] = (int)$mediaInfo['videoStream']['height'];
133
-        $mediaInfo['duration'] = (double)$mediaInfo['videoStream']['duration'];
131
+        $mediaInfo['width'] = (int) $mediaInfo['videoStream']['width'];
132
+        $mediaInfo['height'] = (int) $mediaInfo['videoStream']['height'];
133
+        $mediaInfo['duration'] = (double) $mediaInfo['videoStream']['duration'];
134 134
 
135 135
         return $mediaInfo;
136 136
     }
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.