-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Extract some constants into TransactionIsolationLevel, TrimMode and DateIntervalUnit #2998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
67e6b07
to
c792878
Compare
|
||
namespace Doctrine\DBAL; | ||
|
||
final class TransactionMode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this class defines transaction isolation levels, would it make sense to name it accordingly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. So TransactionIsolation
or TransactionIsolationLevel
?
(edit: Changed to TransactionIsolation
, the other one is a bit too long.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I'd personally prefer TransactionIsolationLevel
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, changed to TransactionIsolationLevel. A bit long, but makes more sence since there's AbstractPlatform::getDefaultTransactionIsolationLevel()
. 👍
* @param integer $pos The position of the trim (leading/trailing/both). | ||
* @param string|boolean $char The char to trim, has to be quoted already. Defaults to space. | ||
* @param string $str The expression to apply the trim to. | ||
* @param int $pos The position of the trim (leading/trailing/both). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should $pos
be renamed to $mode
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, will change that - didn't check variable names to be honest.
c792878
to
3e2191a
Compare
3e2191a
to
6ee8709
Compare
6ee8709
to
f2a8f75
Compare
f2a8f75
to
085c970
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Manually merged via d9aaf54 |
Similar what we did in #2958 with FetchMode and ParameterType, here comes the same for:
Connection::TRANSACTION_*
->TransactionMode
TransactionIsolationLevel
AbstractPlatform::TRIM_*
->TrimMode
AbstractPlatform::DATE_INTERVAL_*
->DateIntervalUnit
This only moves the constants and deprecates the old ones, not actually removing them yet, should be okay for next 2.x.