Skip to content

Commit d5cceda

Browse files
committed
chore: phpstan fixes
1 parent 7408165 commit d5cceda

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

phpstan-baseline.neon

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^PHPDoc tag @var with type Illuminate\\Contracts\\Database\\Query\\Builder is not subtype of native type \$this\(Tpetry\\LaravelMysqlExplain\\Mixins\\BuilderMixin\)\.$#'
5+
identifier: varTag.nativeType
6+
count: 6
7+
path: src/Mixins/BuilderMixin.php

phpstan.neon.dist

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
includes:
2+
- phpstan-baseline.neon
3+
14
parameters:
2-
level: max
5+
level: 9
36
paths:
47
- src
58
checkOctaneCompatibility: true

src/LaravelQuery.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public function execute(string $sql, bool $useParams): array
2626
};
2727

2828
// Laravel creates array<object> instead of array<arrays> as requested by interface.
29+
/** @var array<int, array<string, mixed>> $rows */
2930
$rows = array_map(fn ($row) => (array) $row, $rows);
3031

3132
return $rows;
@@ -34,7 +35,10 @@ public function execute(string $sql, bool $useParams): array
3435
public function getParameters(): array
3536
{
3637
// Transform special values like DateTimeInterface and bool to their string value.
37-
return $this->connection->prepareBindings($this->parameters);
38+
/** @var array<float|int|string> $parameters */
39+
$parameters = $this->connection->prepareBindings($this->parameters);
40+
41+
return $parameters;
3842
}
3943

4044
public function getSql(): string

0 commit comments

Comments
 (0)