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

[Command] Add question helper for unknown or ambiguous commands#19282

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

Closed
hason wants to merge1 commit intosymfony:masterfromhason-contributions:command

Conversation

@hason
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#16261
LicenseMIT
Doc PR

t

linaori, voronkovich, chalasr, pamil, ogizanagi, lexcast, and geekish reacted with thumbs up emojiNek- reacted with hooray emoji
@fabpot
Copy link
Member

Without looking at the code, I cannot understand the difference betweenCommandNotFoundException andUnknownCommandException.

chalasr reacted with thumbs up emoji


public function __construct($namespace, $alternatives = array(), $code = null, $previous = null)
{
$this->command = $namespace;
Copy link
Member

Choose a reason for hiding this comment

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

typo$this->namespace = $namespace;

@chalasr
Copy link
Member

👍 It would be nice to have this.

IMO having several exception classes could be avoided here. Adding an utility method to the CommandNotFoundException that formats the message based on alternatives (i.e. "Did you mean...") should be enough.


if ($alternatives) {
if (1 == count($alternatives)) {
$message .= "\n\nDid you mean this?\n ";
Copy link
Contributor

@ogizanagiogizanagiJul 11, 2016
edited
Loading

Choose a reason for hiding this comment

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

I doubt the exception should format the message rendered in the console itself. Instead, consumers should build the formatted message IMO.

@fabpot
Copy link
Member

@hason Can you take comments into account and rebase? Thanks.

@fabpot
Copy link
Member

Closing as there is no feedback. Feel free to reopen whenever it is ready.

@fabpotfabpot closed thisJul 6, 2017
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

3.4

Development

Successfully merging this pull request may close these issues.

6 participants

@hason@fabpot@chalasr@ogizanagi@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp