Skip to content

Commit

Permalink
Remove duplicate of code (#410)
Browse files Browse the repository at this point in the history
* Remove duplicate of code

* fix for phpdoc (remove oracle from comment for after and first)
  • Loading branch information
darkdef committed Dec 11, 2022
1 parent a42f5bc commit bedec86
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
18 changes: 17 additions & 1 deletion src/Driver/PDO/ConnectionPDO.php
Expand Up @@ -189,5 +189,21 @@ public function setEmulatePrepare(bool $value): void
$this->emulatePrepare = $value;
}

abstract protected function initConnection(): void;
/**
* Initializes the DB connection.
*
* This method is invoked right after the DB connection is established.
*
* The default implementation turns on `PDO::ATTR_EMULATE_PREPARES`.
*
* if {@see emulatePrepare} is true, and sets the database {@see charset} if it is not empty.
*/
protected function initConnection(): void
{
if ($this->getEmulatePrepare() !== null) {
$this->driver->attributes([PDO::ATTR_EMULATE_PREPARES => $this->getEmulatePrepare()]);
}

$this->pdo = $this->driver->createConnection();
}
}
4 changes: 2 additions & 2 deletions src/Schema/ColumnSchemaBuilder.php
Expand Up @@ -176,7 +176,7 @@ public function unsigned(): self
/**
* Adds an `AFTER` constraint to the column.
*
* Note: MySQL, Oracle support only.
* Note: MySQL support only.
*
* @param string $after the column after which $this column will be added.
*
Expand All @@ -192,7 +192,7 @@ public function after(string $after): self
/**
* Adds an `FIRST` constraint to the column.
*
* Note: MySQL, Oracle support only.
* Note: MySQL support only.
*
* @return $this
*/
Expand Down

0 comments on commit bedec86

Please sign in to comment.