diff --git a/lib/Doctrine/DBAL/Connection.php b/lib/Doctrine/DBAL/Connection.php index 58df9ec3724..809da98e14b 100644 --- a/lib/Doctrine/DBAL/Connection.php +++ b/lib/Doctrine/DBAL/Connection.php @@ -493,12 +493,11 @@ public function isAutoCommit() * * @see isAutoCommit * - * @param bool $autoCommit True to enable auto-commit mode; false to disable it. + * @throws ConnectionException + * @throws DriverException */ - public function setAutoCommit($autoCommit) + public function setAutoCommit(bool $autoCommit) : void { - $autoCommit = (bool) $autoCommit; - // Mode not changed, no-op. if ($autoCommit === $this->autoCommit) { return; diff --git a/tests/Doctrine/Tests/DBAL/ConnectionTest.php b/tests/Doctrine/Tests/DBAL/ConnectionTest.php index dfd89f80dd6..48574a4b8ae 100644 --- a/tests/Doctrine/Tests/DBAL/ConnectionTest.php +++ b/tests/Doctrine/Tests/DBAL/ConnectionTest.php @@ -251,8 +251,6 @@ public function testSetAutoCommit() : void { $this->connection->setAutoCommit(false); self::assertFalse($this->connection->isAutoCommit()); - $this->connection->setAutoCommit(0); - self::assertFalse($this->connection->isAutoCommit()); } /**