@@ -63,7 +63,7 @@ public static function createTable($args)
6363
6464 public static function table ($ table )
6565 {
66- return new class ($ table ) {
66+ return new class ($ table ) {
6767 private $ table ;
6868
6969 public function __construct ($ table )
@@ -79,7 +79,7 @@ public function addRow($row)
7979 public function allRows ()
8080 {
8181 $ rows = [];
82- foreach ((FakeDB::$ fakeRows [$ this ->table ] ?? []) as $ i => $ row ) {
82+ foreach ((FakeDB::$ fakeRows [$ this ->table ] ?? []) as $ i => $ row ) {
8383 $ rows [$ i ] = $ row [$ this ->table ];
8484 }
8585
@@ -189,12 +189,12 @@ public static function sort($comparisons, Collection $collection)
189189
190190 $ result = 0 ;
191191
192- if (! is_string ($ prop ) && is_callable ($ prop )) {
192+ if (!is_string ($ prop ) && is_callable ($ prop )) {
193193 $ result = $ prop ($ a , $ b );
194194 } else {
195195 $ values = [data_get ($ a , $ prop ), data_get ($ b , $ prop )];
196196
197- if (! $ ascending ) {
197+ if (!$ ascending ) {
198198 $ values = array_reverse ($ values );
199199 }
200200
@@ -241,7 +241,7 @@ public static function performSelects($collection, $columns, $selects, $_table)
241241 return $ collection ->map (function ($ item ) use ($ columns , $ aliases , $ _table ) {
242242 if ($ columns !== ['* ' ]) {
243243 foreach ($ columns as $ i => $ col ) {
244- ! Str::contains ($ col , '. ' ) && $ columns [$ i ] = $ _table .'. ' .$ col ;
244+ !Str::contains ($ col , '. ' ) && $ columns [$ i ] = $ _table .'. ' .$ col ;
245245 }
246246 $ newItem = [];
247247 foreach ($ columns as $ col ) {
@@ -362,7 +362,7 @@ public static function isLike($value, $pattern, $item): bool
362362 {
363363 $ pattern = str_replace ('% ' , '.* ' , preg_quote ($ pattern , '/ ' ));
364364
365- return (bool ) ( preg_match ("/^ {$ pattern }$/i " , data_get ($ item , $ value ) ?? '' ) );
365+ return (bool ) preg_match ("/^ {$ pattern }$/i " , data_get ($ item , $ value ) ?? '' );
366366 }
367367
368368 public static function whereColumn ($ where , $ row )
@@ -436,7 +436,7 @@ public static function lastInsertId()
436436
437437 public static function prefixColumn ($ column , $ mainTable , $ joins )
438438 {
439- if (! Str::contains ($ column , '. ' ) && ! isset (FakeDB::$ fakeRows [$ mainTable ][0 ][$ mainTable ][$ column ]) && $ joins ) {
439+ if (!Str::contains ($ column , '. ' ) && !isset (FakeDB::$ fakeRows [$ mainTable ][0 ][$ mainTable ][$ column ]) && $ joins ) {
440440 foreach ($ joins as $ joined ) {
441441 $ table = $ joined ->table ;
442442 if (isset (FakeDB::$ fakeRows [$ table ][0 ][$ table ][$ column ])) {
@@ -445,7 +445,7 @@ public static function prefixColumn($column, $mainTable, $joins)
445445 }
446446 }
447447
448- if (! Str::contains ($ column , '. ' )) {
448+ if (!Str::contains ($ column , '. ' )) {
449449 $ column = $ mainTable .'. ' .$ column ;
450450 }
451451
@@ -505,7 +505,7 @@ public static function filter($query, $columns = ['*']): Collection
505505
506506 $ orderBy && ($ collection = self ::sortRows ($ collection , $ orderBy ));
507507
508- if (! FakeDB::$ ignoreWheres ) {
508+ if (!FakeDB::$ ignoreWheres ) {
509509 $ collection = FakeDB::applyWheres ($ query , $ collection );
510510 }
511511
@@ -520,11 +520,11 @@ public static function filter($query, $columns = ['*']): Collection
520520
521521 public static function sortRows (Collection $ collection , $ orderBy )
522522 {
523- if (! $ orderBy ) {
523+ if (!$ orderBy ) {
524524 return $ collection ;
525525 }
526526 if (count ($ orderBy ) === 1 && is_object ($ orderBy [0 ]['sql ' ] ?? '' )) {
527- $ data = ( $ orderBy [0 ]['sql ' ]) ->data ;
527+ $ data = $ orderBy [0 ]['sql ' ]->data ;
528528 if ($ data ['type ' ] === 'random ' ) {
529529 return $ collection ->shuffle ((int ) $ data ['seed ' ]);
530530 }
@@ -718,15 +718,15 @@ public static function delete($query)
718718
719719 public static function insertGetId (array $ values , $ table )
720720 {
721- if (! Arr::isAssoc ($ values )) {
721+ if (!Arr::isAssoc ($ values )) {
722722 foreach ($ values as $ value ) {
723723 self ::insertGetId ($ value , $ table );
724724 }
725725
726726 return true ;
727727 }
728728
729- if (! isset ($ values ['id ' ])) {
729+ if (!isset ($ values ['id ' ])) {
730730 $ values ['id ' ] = (FakeDB::$ tables [$ table ]['latestRowId ' ] ?? 0 ) + 1 ;
731731 }
732732
0 commit comments