Skip to content

Commit 9a45df6

Browse files
Fix 6: Remove unnecessary methods, fix phpdoc. (#389)
* Remove unnecessary methods, fix phpdoc. (#389)
1 parent 7f4b74b commit 9a45df6

3 files changed

Lines changed: 6 additions & 18 deletions

File tree

src/Connection/ConnectionInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ public function getTransaction(): TransactionInterface|null;
185185
*/
186186
public function isActive(): bool;
187187

188+
/**
189+
* @return bool whether this DBMS supports [savepoint](http://en.wikipedia.org/wiki/Savepoint).
190+
*/
188191
public function isSavepointEnabled(): bool;
189192

190193
/**

src/Driver/PDO/TransactionPDO.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ public function begin(string $isolationLevel = null): void
7373
return;
7474
}
7575

76-
$schema = $this->db->getSchema();
77-
78-
if ($schema->supportsSavepoint()) {
76+
if ($this->db->isSavepointEnabled()) {
7977
$this->logger?->log(LogLevel::DEBUG, 'Set savepoint ' . $this->level . ' ' . __METHOD__);
8078

8179
$this->createSavepoint('LEVEL' . $this->level);
@@ -108,9 +106,7 @@ public function commit(): void
108106
return;
109107
}
110108

111-
$schema = $this->db->getSchema();
112-
113-
if ($schema->supportsSavepoint()) {
109+
if ($this->db->isSavepointEnabled()) {
114110
$this->logger?->log(LogLevel::DEBUG, 'Release savepoint ' . $this->level . ' ' . __METHOD__);
115111
$this->releaseSavepoint('LEVEL' . $this->level);
116112
} else {
@@ -160,8 +156,7 @@ public function rollBack(): void
160156
return;
161157
}
162158

163-
$schema = $this->db->getSchema();
164-
if ($schema->supportsSavepoint()) {
159+
if ($this->db->isSavepointEnabled()) {
165160
$this->logger?->log(LogLevel::DEBUG, 'Roll back to savepoint ' . $this->level . ' ' . __METHOD__);
166161
$this->rollBackSavepoint('LEVEL' . $this->level);
167162
} else {

src/Schema/SchemaInterface.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ interface SchemaInterface extends ConstraintSchemaInterface
1717
*/
1818
public function getDefaultSchema(): string|null;
1919

20-
/**
21-
* @inheritDoc
22-
*/
23-
public function getLastInsertID(string $sequenceName = null): string;
24-
2520
/**
2621
* Determines the PDO type for the given PHP data value.
2722
*
@@ -165,11 +160,6 @@ public function refreshTableSchema(string $name): void;
165160
*/
166161
public function schemaCacheEnable(bool $value): void;
167162

168-
/**
169-
* @return bool whether this DBMS supports [savepoint](http://en.wikipedia.org/wiki/Savepoint).
170-
*/
171-
public function supportsSavepoint(): bool;
172-
173163
/**
174164
* Returns all view names in the database.
175165
*

0 commit comments

Comments
 (0)