Passed
Push — develop ( 9c2569...4e2a5f )
by Henry
01:53
created
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/ActiveRecord.php 1 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/Controllers/MediaRequestHandler.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
     public $searchConditions = [
41 41
         'Caption' => [
42
-            'qualifiers' => ['any','caption']
42
+            'qualifiers' => ['any', 'caption']
43 43
             ,'points' => 2
44 44
             ,'sql' => 'Caption LIKE "%%%s%%"',
45 45
         ]
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         } elseif ($_SERVER['REQUEST_METHOD'] == 'PUT') {
192 192
             $put = fopen(static::$inputStream, 'r'); // open input stream
193 193
 
194
-            $tmp = tempnam('/tmp', 'dvr');  // use PHP to make a temporary file
194
+            $tmp = tempnam('/tmp', 'dvr'); // use PHP to make a temporary file
195 195
             $fp = fopen($tmp, 'w'); // open write stream to temp file
196 196
 
197 197
             // write
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
         }
228 228
 
229 229
         return $this->respond('uploadComplete', [
230
-            'success' => (boolean)$Media
230
+            'success' => (boolean) $Media
231 231
             ,'data' => $Media,
232 232
         ]);
233 233
     }
@@ -277,11 +277,11 @@  discard block
 block discarded – undo
277 277
             }
278 278
 
279 279
             // send caching headers
280
-            $expires = 60*60*24*365;
280
+            $expires = 60 * 60 * 24 * 365;
281 281
             if (!headers_sent()) {
282 282
                 // @codeCoverageIgnoreStart
283 283
                 header("Cache-Control: public, max-age=$expires");
284
-                header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time()+$expires));
284
+                header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + $expires));
285 285
                 header('Pragma: public');
286 286
                 // @codeCoverageIgnoreEnd
287 287
             }
@@ -524,9 +524,9 @@  discard block
 block discarded – undo
524 524
         // send caching headers
525 525
         if (!headers_sent()) {
526 526
             // @codeCoverageIgnoreStart
527
-            $expires = 60*60*24*365;
527
+            $expires = 60 * 60 * 24 * 365;
528 528
             header("Cache-Control: public, max-age=$expires");
529
-            header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time()+$expires));
529
+            header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + $expires));
530 530
             header('Pragma: public');
531 531
             // @codeCoverageIgnoreEnd
532 532
         }
Please login to merge, or discard this patch.