Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[String] fix before/after[Last]() returning the empty string instead of the original one on non-match#38678

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Nyholm merged 1 commit intosymfony:5.1fromnicolas-grekas:s-fix-before-after
Oct 22, 2020

Conversation

@nicolas-grekas
Copy link
Member

QA
Branch?5.1
Bug fix?yes
New feature?no
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

The current behavior is the least useful one. Returning the original string when no match is found is the most sensible behavior. It saves code instead of requiring more.

Typical example is when removing a potential suffix:
$bar = $foo->beforeLast(['.svg', '.png']); should remove any of these extensions if found, and return the original string otherwise.

Copy link
Member

@javiereguiluzjaviereguiluz left a comment

Choose a reason for hiding this comment

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

I agree and I also think that this change is a "bug fix" and not a "BC break".

Copy link
Member

@NyholmNyholm left a comment

Choose a reason for hiding this comment

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

Thank you

@NyholmNyholm merged commit310926f intosymfony:5.1Oct 22, 2020
@nicolas-grekasnicolas-grekas deleted the s-fix-before-after branchOctober 26, 2020 18:10
This was referencedOct 28, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

@NyholmNyholmNyholm approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.1

Development

Successfully merging this pull request may close these issues.

4 participants

@nicolas-grekas@javiereguiluz@Nyholm@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp