Skip to content

Commit dcea1fd

Browse files
committed
fix cs
1 parent 386c18a commit dcea1fd

4 files changed

Lines changed: 6 additions & 24 deletions

File tree

phpstan-baseline.neon

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ parameters:
4343
path: src/Cursor.php
4444

4545
-
46-
message: '#^Method Patchlevel\\Rango\\Cursor\:\:toArray\(\) should return array\<int\|string, TDocument of array\<string, mixed\>\> but returns array\<array\<string, mixed\>\>\.$#'
46+
message: '#^Method Patchlevel\\Rango\\Cursor\:\:toArray\(\) should return list\<TDocument of array\<string, mixed\>\> but returns array\<array\<string, mixed\>\>\.$#'
4747
identifier: return.type
4848
count: 1
4949
path: src/Cursor.php
5050

5151
-
52-
message: '#^Method Patchlevel\\Rango\\Cursor\:\:toArray\(\) should return array\<int\|string, TDocument of array\<string, mixed\>\> but returns list\<array\<string, mixed\>\>\.$#'
52+
message: '#^Method Patchlevel\\Rango\\Cursor\:\:toArray\(\) should return list\<TDocument of array\<string, mixed\>\> but returns list\<array\<string, mixed\>\>\.$#'
5353
identifier: return.type
5454
count: 1
5555
path: src/Cursor.php
@@ -336,12 +336,6 @@ parameters:
336336
count: 1
337337
path: src/QueryBuilder.php
338338

339-
-
340-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with MongoDB\\Collection\|Patchlevel\\Rango\\Collection\<array\<string, mixed\>\> will always evaluate to true\.$#'
341-
identifier: method.alreadyNarrowedType
342-
count: 1
343-
path: tests/IntegrationTest.php
344-
345339
-
346340
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertNotNull\(\) with MongoDB\\Database\|Patchlevel\\Rango\\Database will always evaluate to true\.$#'
347341
identifier: method.alreadyNarrowedType

src/Client.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Patchlevel\Rango\Sql\Identifier;
88
use PDO;
9+
910
use function sprintf;
1011

1112
final class Client
@@ -33,11 +34,7 @@ public function selectDatabase(string $name): Database
3334
return $this->getDatabase($name);
3435
}
3536

36-
/**
37-
* @template TDocument of array<string, mixed>
38-
*
39-
* @return Collection<TDocument>
40-
*/
37+
/** @return Collection<array<string, mixed>> */
4138
public function selectCollection(string $databaseName, string $collectionName): Collection
4239
{
4340
return $this->getDatabase($databaseName)->getCollection($collectionName);

src/Database.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,13 @@ public function __construct(
1212
) {
1313
}
1414

15-
/**
16-
* @template TDocument of array<string, mixed>
17-
*
18-
* @return Collection<TDocument>
19-
*/
15+
/** @return Collection<array<string, mixed>> */
2016
public function getCollection(string $collectionName): Collection
2117
{
2218
return new Collection($this->client, $this->databaseName, $collectionName);
2319
}
2420

25-
/**
26-
* @template TDocument of array<string, mixed>
27-
*
28-
* @return Collection<TDocument>
29-
*/
21+
/** @return Collection<array<string, mixed>> */
3022
public function selectCollection(string $collectionName): Collection
3123
{
3224
return $this->getCollection($collectionName);

tests/IntegrationTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,6 @@ public function testSelectAliases(): void
13001300
$this->assertNotNull($db);
13011301

13021302
$col = $db->selectCollection('items');
1303-
$this->assertNotNull($col);
13041303

13051304
$col->insertOne(['_id' => 'alias-test', 'name' => 'alias']);
13061305
$doc = $col->findOne(['_id' => 'alias-test']);

0 commit comments

Comments
 (0)