Skip to content
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

Changed the type of $char in AbstractPlatform::getTrimExpression()from string|false to ?string #3491

Merged
merged 1 commit into from
Mar 18, 2019

Conversation

morozov
Copy link
Member

@morozov morozov commented Mar 17, 2019

Q A
Type improvement
BC Break yes

This breaking change is needed to enforce the type of $char natively to ?string. The existing approach of using false to specify the absence of a value is incorrect since false is the opposite of true which doesn't make sense as the value of $char, while null is exactly what should be used in this case.

"REVERSE(SUBSTR(REVERSE(SUBSTR(column, PATINDEX('%[^' + c + ']%', column))), PATINDEX('%[^' + c + ']%', " .
"REVERSE(SUBSTR(column, PATINDEX('%[^' + c + ']%', column))))))",
$this->platform->getTrimExpression('column', null, 'c')
);
Copy link
Member Author

@morozov morozov Mar 17, 2019

Choose a reason for hiding this comment

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

This case abuses the API and covers the same scenario as the following one.

@morozov morozov requested review from Majkl578 and Ocramius March 17, 2019 22:10
@morozov morozov requested a review from Ocramius March 17, 2019 23:19
@Ocramius Ocramius self-assigned this Mar 18, 2019
@Ocramius Ocramius added this to the 3.0.0 milestone Mar 18, 2019
@Ocramius Ocramius merged commit a640b82 into doctrine:develop Mar 18, 2019
morozov pushed a commit that referenced this pull request Mar 18, 2019
Changed the type of $char in AbstractPlatform::getTrimExpression()`from string|false to ?string
@morozov morozov deleted the get-trim-expr branch March 18, 2019 14:27
morozov pushed a commit that referenced this pull request Apr 16, 2019
Changed the type of $char in AbstractPlatform::getTrimExpression()`from string|false to ?string
morozov pushed a commit that referenced this pull request May 6, 2019
Changed the type of $char in AbstractPlatform::getTrimExpression()`from string|false to ?string
morozov pushed a commit that referenced this pull request May 23, 2019
Changed the type of $char in AbstractPlatform::getTrimExpression()`from string|false to ?string
morozov pushed a commit to morozov/dbal that referenced this pull request May 31, 2019
Changed the type of $char in AbstractPlatform::getTrimExpression()`from string|false to ?string
morozov pushed a commit that referenced this pull request Jun 13, 2019
Changed the type of $char in AbstractPlatform::getTrimExpression()`from string|false to ?string
morozov pushed a commit that referenced this pull request Jun 27, 2019
Changed the type of $char in AbstractPlatform::getTrimExpression()`from string|false to ?string
morozov pushed a commit that referenced this pull request Jun 27, 2019
Changed the type of $char in AbstractPlatform::getTrimExpression()`from string|false to ?string
morozov pushed a commit that referenced this pull request Jun 27, 2019
Changed the type of $char in AbstractPlatform::getTrimExpression()`from string|false to ?string
morozov pushed a commit to morozov/dbal that referenced this pull request Aug 26, 2019
Changed the type of $char in AbstractPlatform::getTrimExpression()`from string|false to ?string
morozov pushed a commit that referenced this pull request Nov 2, 2019
Changed the type of $char in AbstractPlatform::getTrimExpression()`from string|false to ?string
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2022
@morozov morozov changed the title Changed the type of $char in AbstractPlatform::getTrimExpression()`from string|false to ?string Changed the type of $char in AbstractPlatform::getTrimExpression()from string|false to ?string 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.

2 participants