Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Console] Add Helper::width() and Helper::length()#40698
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
chalasr commentedApr 3, 2021
Fromhttps://semver.org/#spec-item-7
Should we mark the new methods as |
Nyholm commentedApr 3, 2021
Oh, thank you. The PR is updated |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas commentedApr 5, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
about the name, what about length() and width()? On 5.x, I'd be in favor of deprecating the current methods, including strlenWithoutDecoration(), and tell ppl to use removeDecoration instead. if you agree with this plan, we could skip using strlenWithoutDecoration() in this PR. WDYT? |
chalasr commentedApr 5, 2021
Agree 👍 |
| $string =self::removeDecoration($formatter,$string); | ||
| if (preg_match('//u',$string)) { | ||
| return (newUnicodeString($string))->width(true); |
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.
Thetrue here is for "remove ansi decoration", but that is already done inself::removeDecoration.
Nyholm commentedApr 5, 2021
Thank you for the reviews. The PR is updated. |
Uh oh!
There was an error while loading.Please reload this page.
jderusse commentedApr 5, 2021
If we deprecated |
chalasr commentedApr 5, 2021
They will no longer be internal as soon as they will be publicly introduced in 5.3, at the same time we will deprecate |
fabpot commentedApr 8, 2021
Thank you@Nyholm. |
Nyholm commentedApr 8, 2021
Great. Thank you for merging |
…ength() (Nyholm)This PR was squashed before being merged into the 5.3-dev branch.Discussion----------[Console] Deprecate Helper::strlen() for width() and length()| Q | A| ------------- | ---| Branch? | 5.2| Bug fix? | yes| New feature? | yes| Deprecations? | yes| Tickets | Follow up form#40698| License | MIT| Doc PR |This PR will deprecated `Helper::strlen()` since it is actually calculating the width. I remove the `@internal` on `Helper::width()` and a `Helper::length()`. I will also deprecate `Helper::strlenWithoutDecoration()` because you should use `Helper::removeDecoration()` instead.Commits-------3c24aa9 [Console] Deprecate Helper::strlen() for width() and length()
Uh oh!
There was an error while loading.Please reload this page.
This PR will add add a Helper::strwidth() and a Helper::strlength(). Same with with the Helper::strlenWithoutDecoration(). It does not deprecate anything. That is done in#40695
With this PR we dont have to revert the emoji issue (ieclose#40697)
FYI@grasmash, I used your tests from#40635