Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/Adapter/Driver/ConnectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ public function getConnectionParameters(): array;
/**
* Get last generated id
*
* @param null $name Ignored (this is not ignored for PDO), imagine that...
*
* todo: narrow this to string|int|bool|null
* until version bumps to PHP 8.2 minimum then narrow to string|int|false
* $name Ignored (this is not ignored for PDO), imagine that...
*/
public function getLastGeneratedValue($name = null): string|int|bool|null;
public function getLastGeneratedValue(?string $name = null): string|int|false;

/**
* Get resource
Expand Down
6 changes: 2 additions & 4 deletions test/unit/Adapter/Driver/Pdo/TestAsset/TestConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@ private function buildDsn(): string
};
}

/**
* @param string|null $name
*/
/** @phpstan-ignore return.unusedType */
#[Override]
public function getLastGeneratedValue($name = null): string|bool|null
public function getLastGeneratedValue(?string $name = null): string|int|false
{
return $this->resource?->lastInsertId($name) ?? null;
}
Expand Down
4 changes: 2 additions & 2 deletions test/unit/TestAsset/ConnectionWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public function getCurrentSchema(): string
return 'test_schema';
}

public function getLastGeneratedValue(mixed $name = null): int|string|bool|null
public function getLastGeneratedValue(?string $name = null): string|int|false
{
return null;
return false;
}

public function getNestedTransactionsCount(): int
Expand Down