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] Fix traversable autocomplete values#24929

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:2.7fromro0NL:console/traversable-autocomplete
Nov 12, 2017
Merged

[Console] Fix traversable autocomplete values#24929

fabpot merged 1 commit intosymfony:2.7fromro0NL:console/traversable-autocomplete
Nov 12, 2017

Conversation

@ro0NL
Copy link
Contributor

@ro0NLro0NL commentedNov 11, 2017
edited
Loading

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#...
LicenseMIT
Doc PRsymfony/symfony-docs#...

Question::setAutocompleterValues implies passing a\Traversable value is allowed, yet it doesnt work :) It also restricts the traversable to be countable, which is not really needed (blocking pure API / iterable type as of 4.0).

}
}else {
$ret =trim($this->autocomplete($output,$question,$inputStream));
$ret =trim($this->autocomplete($output,$question,$inputStream,is_array($autocomplete) ?$autocomplete :iterator_to_array($autocomplete,false)));
Copy link
ContributorAuthor

@ro0NLro0NLNov 11, 2017
edited
Loading

Choose a reason for hiding this comment

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

passingfalse toiterator_to_array fixes

1) Symfony\Component\Console\Tests\Helper\QuestionHelperTest::testTraversableAutocompleteUndefined offset: 3src/Symfony/Component/Console/Helper/QuestionHelper.php:294

in case of assoc array keys (which we dont really care about)

of course usingiterator_to_array fixes the offset access in the first place ;)

@fabpot
Copy link
Member

Thank you@ro0NL.

@fabpotfabpot merged commit965b5b5 intosymfony:2.7Nov 12, 2017
fabpot added a commit that referenced this pull requestNov 12, 2017
This PR was merged into the 2.7 branch.Discussion----------[Console] Fix traversable autocomplete values| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->`Question::setAutocompleterValues` implies passing a `\Traversable` value is allowed, yet it doesnt work :) It also restricts the traversable to be countable, which is not really needed (blocking pure API / iterable type as of 4.0).Commits-------965b5b5 [Console] Fix traversable autocomplete values
@ro0NLro0NL deleted the console/traversable-autocomplete branchNovember 12, 2017 16:13
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@ro0NL@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp