Skip to content

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

Closed
wants to merge 3 commits into from

Conversation

Majkl578
Copy link
Contributor

@Majkl578 Majkl578 commented Jan 27, 2018

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.

@Majkl578 Majkl578 added this to the 3.0.0 milestone Jan 27, 2018
@Majkl578 Majkl578 requested a review from morozov January 27, 2018 18:03
@Majkl578 Majkl578 modified the milestones: 3.0.0, 2.7.0 Jan 27, 2018

namespace Doctrine\DBAL;

final class TransactionMode
Copy link
Member

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?

Copy link
Contributor Author

@Majkl578 Majkl578 Jan 27, 2018

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.)

Copy link
Member

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.

Copy link
Contributor Author

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).
Copy link
Member

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?

Copy link
Contributor Author

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.

@Majkl578 Majkl578 changed the title Extract some constants into TransactionMode, TrimMode and DateIntervalUnit Extract some constants into TransactionIsolation, TrimMode and DateIntervalUnit Jan 27, 2018
@Majkl578 Majkl578 changed the title Extract some constants into TransactionIsolation, TrimMode and DateIntervalUnit Extract some constants into TransactionIsolationLevel, TrimMode and DateIntervalUnit Jan 27, 2018
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Ocramius Ocramius closed this in d9aaf54 Jan 29, 2018
@Ocramius
Copy link
Member

Manually merged via d9aaf54

@Ocramius Ocramius self-assigned this Jan 29, 2018
@Majkl578 Majkl578 deleted the extract-constants branch January 29, 2018 21:37
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants