Skip to content

Commit bca4187

Browse files
authored
Rename getLastInsertID() method in ConnectionInterface to getLastInsertId() (#406)
1 parent 3a1459f commit bca4187

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ public function getColumnFactory(): ColumnFactoryInterface
5151
return $this->columnFactory ??= new ColumnFactory();
5252
}
5353

54-
public function getLastInsertID(?string $sequenceName = null): string
54+
public function getLastInsertId(?string $sequenceName = null): string
5555
{
5656
if ($sequenceName === null) {
5757
throw new InvalidArgumentException('PostgreSQL not support lastInsertId without sequence name.');
5858
}
5959

60-
return parent::getLastInsertID($sequenceName);
60+
return parent::getLastInsertId($sequenceName);
6161
}
6262

6363
public function getQueryBuilder(): QueryBuilderInterface

tests/PdoConnectionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testGetLastInsertID(): void
4141
]
4242
)->execute();
4343

44-
$this->assertSame('4', $db->getLastInsertID('public.customer_id_seq'));
44+
$this->assertSame('4', $db->getLastInsertId('public.customer_id_seq'));
4545

4646
$db->close();
4747
}
@@ -63,7 +63,7 @@ public function testGetLastInsertIDWithException(): void
6363
$this->expectException(InvalidArgumentException::class);
6464
$this->expectExceptionMessage('PostgreSQL not support lastInsertId without sequence name.');
6565

66-
$db->getLastInsertID();
66+
$db->getLastInsertId();
6767

6868
$db->close();
6969
}

0 commit comments

Comments
 (0)