Skip to content

Commit 35d2280

Browse files
committed
fix: phpstan issues
1 parent 2f08d1c commit 35d2280

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/Schema/Grammars/GrammarIndex.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,19 @@ private function genericCompileCreateIndex(Blueprint $blueprint, Fluent $command
167167

168168
$index = [
169169
$unique ? 'create unique index' : 'create index',
170-
$command['concurrently'] ? 'concurrently' : '',
171-
$command['ifNotExists'] ? 'if not exists' : '',
170+
$command['concurrently'] ? 'concurrently' : null,
171+
$command['ifNotExists'] ? 'if not exists' : null,
172172
$this->wrap($command['index']),
173173
'on',
174174
$this->wrapTable($blueprint),
175-
$command['algorithm'] ? "using {$command['algorithm']}" : '',
175+
$command['algorithm'] ? "using {$command['algorithm']}" : null,
176176
'('.implode(', ', $columns).')',
177-
$command['include'] ? 'include ('.implode(',', $this->wrapArray(Arr::wrap($command['include']))).')' : '',
178-
$command['nullsNotDistinct'] ? 'nulls not distinct' : '',
179-
$command['with'] ? "with ({$command['with']})" : '',
180-
$command['where'] ? "where {$command['where']}" : '',
177+
$command['include'] ? 'include ('.implode(',', $this->wrapArray(Arr::wrap($command['include']))).')' : null,
178+
$command['nullsNotDistinct'] ? 'nulls not distinct' : null,
179+
$command['with'] ? "with ({$command['with']})" : null,
180+
$command['where'] ? "where {$command['where']}" : null,
181181
];
182-
$sql = implode(' ', array_filter($index, fn ($part) => $part));
182+
$sql = implode(' ', array_filter($index, fn (?string $part) => filled($part)));
183183

184184
return $sql;
185185
}

src/Schema/Grammars/GrammarTrigger.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function compileTrigger(Blueprint $blueprint, Fluent $command): string
3737
$new = transform($command['transitionTables']['new'], fn (string $table) => "new table as {$this->wrap($table)}");
3838
$old = transform($command['transitionTables']['old'], fn (string $table) => "old table as {$this->wrap($table)}");
3939
if (filled($new) || filled($old)) {
40-
$referencing = implode(' ', array_filter(['referencing', $new, $old], fn ($part) => $part));
40+
$referencing = implode(' ', array_filter(['referencing', $new, $old], fn (?string $part) => filled($part)));
4141
}
4242
}
4343

@@ -68,7 +68,7 @@ public function compileTrigger(Blueprint $blueprint, Fluent $command): string
6868
$when ?? null,
6969
"execute function {$command['action']}",
7070
];
71-
$sql = implode(' ', array_filter($index, fn ($part) => $part));
71+
$sql = implode(' ', array_filter($index, fn (?string $part) => filled($part)));
7272

7373
return $sql;
7474
}

0 commit comments

Comments
 (0)