Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed type and initialization value of $_nestTransactionsWithSavepoints #569

Merged
merged 1 commit into from

5 participants

Benjamin Morel doctrinebot Steve Müller Marco Pivetta Guilherme Blanco
Benjamin Morel

Connection::$_nestTransactionsWithSavepoints is definitely a boolean and not an integer, and the rest of the code assumes it's false by default, whereas it's actually null right now. Which still works as null evaluates as false, but is not clean.

doctrinebot
Collaborator

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

http://www.doctrine-project.org/jira/browse/DBAL-871

We use Jira to track the state of pull requests and the versions they got
included in.

Steve Müller
Collaborator

:+1:

Marco Pivetta Ocramius commented on the diff
lib/Doctrine/DBAL/Connection.php
((6 lines not shown))
*/
- private $_nestTransactionsWithSavepoints;
+ private $_nestTransactionsWithSavepoints = false;
Marco Pivetta Owner

Can you also cast to (bool) in the relevant assignment operations?

@Ocramius done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Guilherme Blanco guilhermeblanco merged commit aa2ed45 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/Doctrine/DBAL/Connection.php
6 lib/Doctrine/DBAL/Connection.php
View
@@ -142,9 +142,9 @@ class Connection implements DriverConnection
/**
* If nested transactions should use savepoints.
*
- * @var integer
+ * @var boolean
*/
- private $_nestTransactionsWithSavepoints;
+ private $_nestTransactionsWithSavepoints = false;
Marco Pivetta Owner

Can you also cast to (bool) in the relevant assignment operations?

@Ocramius done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
/**
* The parameters used during creation of the Connection instance.
@@ -1130,7 +1130,7 @@ public function setNestTransactionsWithSavepoints($nestTransactionsWithSavepoint
throw ConnectionException::savepointsNotSupported();
}
- $this->_nestTransactionsWithSavepoints = $nestTransactionsWithSavepoints;
+ $this->_nestTransactionsWithSavepoints = (bool) $nestTransactionsWithSavepoints;
}
/**
Something went wrong with that request. Please try again.