Skip to content

Commit f38d603

Browse files
author
Copilot
committed
Widen ConnectionInterface::getResource() to resource|object|null
1 parent 0de8956 commit f38d603

3 files changed

Lines changed: 2 additions & 24 deletions

File tree

‎analyzer-baseline.toml‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -156,18 +156,6 @@ code = "imprecise-type"
156156
message = "Type `array` in return type of `getConnectionParameters` is imprecise, equivalent to `array<array-key, mixed>`."
157157
count = 1
158158

159-
[[issues]]
160-
file = "src/Adapter/Driver/AbstractConnection.php"
161-
code = "incompatible-return-type"
162-
message = 'Return type `null|resource` of `PhpDb\Adapter\Driver\AbstractConnection::getresource()` is incompatible with parent return type `resource` of `PhpDb\Adapter\Driver\ConnectionInterface::getresource()`'
163-
count = 1
164-
165-
[[issues]]
166-
file = "src/Adapter/Driver/AbstractConnection.php"
167-
code = "incompatible-return-type"
168-
message = 'Return type `null|resource` of `PhpDb\Adapter\Driver\Pdo\AbstractPdoConnection::getresource()` is incompatible with parent return type `resource` of `PhpDb\Adapter\Driver\ConnectionInterface::getresource()`'
169-
count = 1
170-
171159
[[issues]]
172160
file = "src/Adapter/Driver/AbstractConnection.php"
173161
code = "missing-api-or-internal"
@@ -426,12 +414,6 @@ code = "imprecise-type"
426414
message = "Type `array` in parameter `$connectionParameters` is imprecise, equivalent to `array<array-key, mixed>`."
427415
count = 1
428416

429-
[[issues]]
430-
file = "src/Adapter/Driver/Pdo/AbstractPdoConnection.php"
431-
code = "incompatible-property-type"
432-
message = 'Property `PhpDb\Adapter\Driver\Pdo\AbstractPdoConnection::$resource` has an incompatible type declaration from docblock.'
433-
count = 1
434-
435417
[[issues]]
436418
file = "src/Adapter/Driver/Pdo/AbstractPdoConnection.php"
437419
code = "missing-api-or-internal"

‎src/Adapter/Driver/AbstractConnection.php‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ abstract class AbstractConnection implements ConnectionInterface, ProfilerAwareI
2121

2222
protected ?ProfilerInterface $profiler = null;
2323

24-
/**
25-
* Extending classes must be covariant
26-
*
27-
* @var mixed
28-
*/
24+
/** Extending classes must be covariant. */
2925
protected $resource;
3026

3127
#[Override]

‎src/Adapter/Driver/ConnectionInterface.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function getLastGeneratedValue(?string $name = null): string|int|false|nu
3030
/**
3131
* Get resource
3232
*
33-
* @return resource
33+
* @return resource|object|null
3434
*/
3535
public function getResource();
3636

0 commit comments

Comments
 (0)