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

[Console] Deprecate Helper::strlen() for width() and length()#40695

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
fabpot merged 1 commit intosymfony:5.xfromNyholm:console-strlength
Apr 9, 2021

Conversation

@Nyholm
Copy link
Member

@NyholmNyholm commentedApr 3, 2021
edited
Loading

QA
Branch?5.2
Bug fix?yes
New feature?yes
Deprecations?yes
TicketsFollow up form#40698
LicenseMIT
Doc PR

This PR will deprecatedHelper::strlen() since it is actually calculating the width. I remove the@internal onHelper::width() and aHelper::length(). I will also deprecateHelper::strlenWithoutDecoration() because you should useHelper::removeDecoration() instead.

Copy link
MemberAuthor

@NyholmNyholm left a comment

Choose a reason for hiding this comment

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

There are a lot of changes in this PR, but only the two lines I've marked below is significant, the others are just renaming.

What I fail to understand is that in theTable, it feels like it should be "width" instead of "length". But "length" is the one working".

$display =str_repeat($bar->getBarCharacter(),$completeBars);
if ($completeBars <$bar->getBarWidth()) {
$emptyBars =$bar->getBarWidth() -$completeBars - Helper::strlenWithoutDecoration($output->getFormatter(),$bar->getProgressCharacter());
$emptyBars =$bar->getBarWidth() -$completeBars - Helper::strlengthWithoutDecoration($output->getFormatter(),$bar->getProgressCharacter());
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Note this change.


$width += Helper::strlen($cell) - Helper::strlenWithoutDecoration($this->output->getFormatter(),$cell);
$x =2;
$width += Helper::strlength($cell) - Helper::strlengthWithoutDecoration($this->output->getFormatter(),$cell);
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Note these two changes.

@chalasr
Copy link
Member

We cannot deprecate something in 5.2 as it's a maintenance branch, it should be done on 5.x.
For 5.2, the breaking change made toHelper::strlen() should probably be reverted

@Nyholm
Copy link
MemberAuthor

Thank you. I was hesitant about this.

Are we okey with reverting#40524, adding that PR as a feature to 5.x and then merge this PR in 5.x?

chalasr reacted with thumbs up emoji

@NyholmNyholm changed the base branch from5.2 to5.xApril 3, 2021 11:32
fabpot added a commit that referenced this pull requestApr 8, 2021
…, grasmash)This PR was merged into the 5.2 branch.Discussion----------[Console] Add Helper::width() and Helper::length()| Q             | A| ------------- | ---| Branch?       | 5.2| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       |Close#40697Fix#40634,fix#40635| License       | MIT| Doc PR        |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#40695With this PR we dont have to revert the emoji issue (ieclose#40697)FYI@grasmash, I used your tests from#40635Commits-------d9ea4c5 Add test.dc02ab3 [Console] Add Helper::strwidth() and Helper::strlength()
@NyholmNyholm changed the title[Console] Deprecate Helper::strlen() for strwidth() and strlength()[Console] Deprecate Helper::strlen() for width() and length()Apr 8, 2021
@NyholmNyholm added Feature and removed Bug labelsApr 8, 2021
@chalasrchalasr removed this from the5.2 milestoneApr 8, 2021
@chalasrchalasr added this to the5.x milestoneApr 8, 2021
Copy link
Member

@chalasrchalasr 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 for taking care of this.

Nyholm reacted with heart emoji
@fabpot
Copy link
Member

Thank you@Nyholm.

@Nyholm
Copy link
MemberAuthor

Thank you for merging

@NyholmNyholm deleted the console-strlength branchApril 9, 2021 09:54
@fabpotfabpot mentioned this pull requestApr 18, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@chalasrchalasrchalasr approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

4 participants

@Nyholm@chalasr@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp