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

Fix max width for multibyte keys in choice question#17314

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

Conversation

@marek-pietrzak-tg
Copy link
Contributor

Fixes wrong key max width for ChoiceQuestion in multibyte strings

Before:
before

After:
after

To replicate you can use this code as an example:

namespace AppBundle\Command;use Symfony\Component\Console\Command\Command;use Symfony\Component\Console\Input\InputInterface;use Symfony\Component\Console\Output\OutputInterface;use Symfony\Component\Console\Question\ChoiceQuestion;class QuesionCommand extends Command{    protected function configure()    {        $this->setName('app:question');        $this->setDescription('Command for testing PR');    }    protected function execute(InputInterface $input, OutputInterface $output)    {        $helper = $this->getHelper('question');        $question = new ChoiceQuestion('Choose something:',            [                'foo' => 'foo',                'żółw' => 'bar',                'łabądź' => 'baz',                'известно' => 'lorem',                'газета' => 'ipsum',            ],            0);        $colour = $helper->ask($input, $output, $question);        $output->writeln('you have chosen: ' . $colour);    }}
QA
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#15368
LicenseMIT
Doc PR-

@marek-pietrzak-tgmarek-pietrzak-tg changed the titleFix max width for choice questionFix max width for multibyte keys in choice questionJan 8, 2016
@nicolas-grekas
Copy link
Member

👍
Status: reviewed

@fabpot
Copy link
Member

Thank you @mheki.

fabpot added a commit that referenced this pull requestJan 14, 2016
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes#17314).Discussion----------Fix max width for multibyte keys in choice questionFixes wrong key max width for ChoiceQuestion in multibyte stringsBefore:![before](https://cloud.githubusercontent.com/assets/2435655/12203385/977e88c0-b626-11e5-9425-d497f84a9ab3.png)After:![after](https://cloud.githubusercontent.com/assets/2435655/12203390/9d9a0b4e-b626-11e5-8d4e-ba9290820778.png)To replicate you can use this code as an example:```namespace AppBundle\Command;use Symfony\Component\Console\Command\Command;use Symfony\Component\Console\Input\InputInterface;use Symfony\Component\Console\Output\OutputInterface;use Symfony\Component\Console\Question\ChoiceQuestion;class QuesionCommand extends Command{    protected function configure()    {        $this->setName('app:question');        $this->setDescription('Command for testing PR');    }    protected function execute(InputInterface $input, OutputInterface $output)    {        $helper = $this->getHelper('question');        $question = new ChoiceQuestion('Choose something:',            [                'foo' => 'foo',                'żółw' => 'bar',                'łabądź' => 'baz',                'известно' => 'lorem',                'газета' => 'ipsum',            ],            0);        $colour = $helper->ask($input, $output, $question);        $output->writeln('you have chosen: ' . $colour);    }}```| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#15368| License       | MIT| Doc PR        | -Commits-------5d2463b Fix max width for multibyte keys in choice question
@fabpotfabpot closed thisJan 14, 2016
This was referencedJan 14, 2016
@fabpotfabpot mentioned this pull requestFeb 3, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@marek-pietrzak-tg@nicolas-grekas@fabpot@jakzal@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp