Skip to content

Commit c21ad52

Browse files
authored
chore: better PHPStan support (#244)
1 parent 9be524f commit c21ad52

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# v8.3.0 (2024-11-08)
1+
# v8.3.0 (2024-12-25)
22

33
- add support for full text search (#235)
44
- add support for IDENTITY columns (#243)
@@ -10,6 +10,7 @@
1010
- add support for `Query\Builder::whereNotInUnnest(...)` (#225)
1111
- `Query\Builder::whereIn` will now wrap values in `UNNEST` if the number of values exceeds the limit (950). (#226)
1212
- Commit options can now be set through config or through `Connection::setCommitOptions(...)` (#229)
13+
- improve PHPStan support (#244)
1314

1415
# v8.2.0 (2024-08-05)
1516

phpstan.neon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ parameters:
1313
path: src/Connection.php
1414
- message: '#^Method Colopl\\Spanner\\Connection::selectWithOptions\(\) should return array<int, array> but returns mixed\.$#'
1515
path: src/Connection.php
16-
- message: "#^Method Colopl\\\\Spanner\\\\Connection\\:\\:cursor\\(\\) should return Generator\\<int, stdClass, mixed, mixed\\> but returns Generator\\<int, array, mixed, mixed\\>\\.$#"
17-
path: src/Connection.php
16+
- message: "#^Return type \\(Generator\\<int, array, mixed, mixed\\>\\) of method Colopl\\\\Spanner\\\\Connection\\:\\:cursor\\(\\) should be compatible with return type \\(Generator\\<int, stdClass, mixed, mixed\\>\\) of method Illuminate\\\\Database\\\\Connection\\:\\:cursor\\(\\)$#"
1817
count: 1
18+
path: src/Connection.php
1919
- message: '#^Generator expects value type array, mixed given.$#'
2020
path: src/Connection.php
2121
count: 1

src/Connection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ public function select($query, $bindings = [], $useReadPdo = true): array
252252
}
253253

254254
/**
255-
* @inheritDoc
255+
* {@inheritDoc}
256+
* @return Generator<int, array<array-key, mixed>>
256257
*/
257258
public function cursor($query, $bindings = [], $useReadPdo = true): Generator
258259
{

src/Query/Builder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@
2323
use Illuminate\Contracts\Support\Arrayable;
2424
use Illuminate\Database\Query\Builder as BaseBuilder;
2525
use Illuminate\Support\Arr;
26+
use Illuminate\Support\Collection;
2627
use LogicException;
2728

29+
/**
30+
* @method Collection<int, array<array-key, mixed>> get($columns = ['*'])
31+
*/
2832
class Builder extends BaseBuilder
2933
{
3034
use Concerns\SetsRequestTimeouts;

0 commit comments

Comments
 (0)