From f216a847db458c687d26b36d955bffba8df91643 Mon Sep 17 00:00:00 2001 From: WatheqAlshowaiter Date: Thu, 25 Jul 2024 12:47:01 +0000 Subject: [PATCH] Fix styling --- src/RequiredFields.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/RequiredFields.php b/src/RequiredFields.php index 1ece15b..1875f9a 100644 --- a/src/RequiredFields.php +++ b/src/RequiredFields.php @@ -28,7 +28,7 @@ public static function getRequiredFields( ); } - $primaryIndex = collect(Schema::getIndexes((new self())->getTable())) + $primaryIndex = collect(Schema::getIndexes((new self)->getTable())) ->filter(function ($index) { return $index['primary']; }) @@ -36,7 +36,7 @@ public static function getRequiredFields( ->flatten() ->toArray(); - return collect(Schema::getColumns((new self())->getTable())) + return collect(Schema::getColumns((new self)->getTable())) ->map(function ($column) { // specific to mariadb if ($column['default'] == 'NULL') { $column['default'] = null; @@ -109,7 +109,7 @@ private static function getRequiredFieldsForSqlite( $queryResult = DB::select(/** @lang SQLite */ "PRAGMA table_info($table)"); return collect($queryResult) - ->map(function ($column){ + ->map(function ($column) { return (array) $column; }) ->reject(function ($column) use ($withNullables, $withDefaults, $withPrimaryKey) { @@ -121,7 +121,6 @@ private static function getRequiredFieldsForSqlite( ->toArray(); } - private static function getRequiredFieldsForMysqlAndMariaDb( $withNullables = false, $withDefaults = false, @@ -148,7 +147,7 @@ private static function getRequiredFieldsForMysqlAndMariaDb( ); return collect($queryResult) - ->map(function ($column){ + ->map(function ($column) { return (array) $column; }) ->map(function ($column) { // specific to mariadb @@ -167,7 +166,6 @@ private static function getRequiredFieldsForMysqlAndMariaDb( ->toArray(); } - private static function getRequiredFieldsForPostgres( $withNullables = false, $withDefaults = false, @@ -228,7 +226,7 @@ private static function getRequiredFieldsForPostgres( ); return collect($queryResult) - ->map(function ($column){ + ->map(function ($column) { return (array) $column; }) ->reject(function ($column) use ($primaryIndex, $withDefaults, $withNullables) { @@ -288,7 +286,7 @@ private static function getRequiredFieldsForSqlServer( ); return collect($queryResult) - ->map(function ($column){ + ->map(function ($column) { return (array) $column; }) ->reject(function ($column) use ($withDefaults, $withNullables, $primaryIndex, $withPrimaryKey) { @@ -306,7 +304,7 @@ private static function getRequiredFieldsForSqlServer( */ private static function getTableFromThisModel() { - $table = (new self())->getTable(); + $table = (new self)->getTable(); return str_replace('.', '__', $table); }