fixed phpstorm warnings

This commit is contained in:
silverqx
2021-11-24 14:47:26 +01:00
parent 649f43165e
commit a71ba16800

View File

@@ -53,7 +53,7 @@ function dropAllTables(string $connection): void
function allEnvVariablesEmpty(array $envVariables): bool
{
return collect($envVariables)->every(function (string $envVariable) {
return false === \getenv($envVariable);
return false === getenv($envVariable);
});
}
@@ -396,7 +396,7 @@ function seedTables(string $connection): void
/**
* Fix sequence number for Postgres.
*
* I have to fix sequences in Postgres because I'm inserting IDs manually and
* I have to fix sequences in Postgres because I'm inserting IDs manually, and
* it doesn't increment sequences.
*
* @return void
@@ -418,7 +418,7 @@ function fixSequences(): void
foreach ($sequences as $sequence => $id) {
Capsule::connection('pgsql')
->unprepared("ALTER SEQUENCE {$sequence} RESTART WITH {$id}");
->unprepared("ALTER SEQUENCE $sequence RESTART WITH $id");
}
}
@@ -450,33 +450,33 @@ $capsule->bootEloquent();
$configs = [
'mysql' => [
'driver' => 'mysql',
'host' => \getenv('DB_MYSQL_HOST') ?: '127.0.0.1',
'port' => \getenv('DB_MYSQL_PORT') ?: '3306',
'database' => \getenv('DB_MYSQL_DATABASE') ?: '',
'username' => \getenv('DB_MYSQL_USERNAME') ?: 'root',
'password' => \getenv('DB_MYSQL_PASSWORD') ?: '',
'charset' => \getenv('DB_MYSQL_CHARSET') ?: 'utf8mb4',
'collation' => \getenv('DB_MYSQL_COLLATION') ?: 'utf8mb4_0900_ai_ci',
'host' => getenv('DB_MYSQL_HOST') ?: '127.0.0.1',
'port' => getenv('DB_MYSQL_PORT') ?: '3306',
'database' => getenv('DB_MYSQL_DATABASE') ?: '',
'username' => getenv('DB_MYSQL_USERNAME') ?: 'root',
'password' => getenv('DB_MYSQL_PASSWORD') ?: '',
'charset' => getenv('DB_MYSQL_CHARSET') ?: 'utf8mb4',
'collation' => getenv('DB_MYSQL_COLLATION') ?: 'utf8mb4_0900_ai_ci',
'timezone' => '+00:00',
'prefix' => '',
],
'sqlite' => [
'driver' => 'sqlite',
'database' => \getenv('DB_SQLITE_DATABASE') ?: '',
'database' => getenv('DB_SQLITE_DATABASE') ?: '',
'prefix' => '',
'foreign_key_constraints' => true,
],
'pgsql' => [
'driver' => 'pgsql',
'host' => \getenv('DB_PGSQL_HOST') ?: '127.0.0.1',
'port' => \getenv('DB_PGSQL_PORT') ?: '5432',
'database' => \getenv('DB_PGSQL_DATABASE') ?: 'postgres',
'schema' => \getenv('DB_PGSQL_SCHEMA') ?: 'public',
'username' => \getenv('DB_PGSQL_USERNAME') ?: 'postgres',
'password' => \getenv('DB_PGSQL_PASSWORD') ?: '',
'charset' => \getenv('DB_PGSQL_CHARSET') ?: 'utf8',
'host' => getenv('DB_PGSQL_HOST') ?: '127.0.0.1',
'port' => getenv('DB_PGSQL_PORT') ?: '5432',
'database' => getenv('DB_PGSQL_DATABASE') ?: 'postgres',
'schema' => getenv('DB_PGSQL_SCHEMA') ?: 'public',
'username' => getenv('DB_PGSQL_USERNAME') ?: 'postgres',
'password' => getenv('DB_PGSQL_PASSWORD') ?: '',
'charset' => getenv('DB_PGSQL_CHARSET') ?: 'utf8',
'timezone' => 'UTC',
'sslmode' => 'prefer',
'prefix' => '',