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] Allow to catch CommandNotFoundException#22181

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:masterfromchalasr:cmd-not-found-listener
Apr 5, 2017

Conversation

@chalasr
Copy link
Member

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#22144 (comment)
LicenseMIT
Doc PRn/a

Basically reverts#22144, making the command argument optional in console.error event instead, so thatCommandNotFoundException can be handled as any other console error.

private$handled =false;

publicfunction__construct(Command$command,InputInterface$input,OutputInterface$output,$error,$exitCode)
publicfunction__construct(Command$command =null,InputInterface$input,OutputInterface$output,$error,$exitCode)
Copy link
Member

Choose a reason for hiding this comment

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

It's always weird to have optional argument before required one. Could we do something for that ?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Agreed, arguments have been reordered

@chalasrchalasrforce-pushed thecmd-not-found-listener branch 4 times, most recently from2337015 to0ff0123CompareMarch 27, 2017 17:37
@nicolas-grekasnicolas-grekas added this to the3.3 milestoneMar 28, 2017
@chalasr
Copy link
MemberAuthor

ping@wouterj

$exception =$exitCode;
$exitCode =$tmpExitCode;

@trigger_error(sprintf('Passing an instance of %s as first argument of %s() is deprecated since version 3.3. Pass it as 5th argument instead.', Command::class,__METHOD__),E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

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

This deprecation is useless imo. People creating the class as($command, $input, $output) already get a deprecation, as the class shouldn't be initialized (ConsoleErrorEvent should be initialized instead).

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Indeed, deprecation removed.

@chalasrchalasrforce-pushed thecmd-not-found-listener branch 3 times, most recently fromfc50aef toca50cf9CompareMarch 29, 2017 16:28
private$exitCode;

publicfunction__construct(Command$command,InputInterface$input,OutputInterface$output,\Exception$exception,$exitCode,$deprecation =true)
publicfunction__construct($input,$output,$exception,$exitCode,$command =null,$deprecation =true)
Copy link
Member

Choose a reason for hiding this comment

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

Given that the class is deprecated anyway I would just allow$command to benull instead of shifting constructor arguments.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Thanks, I wasn't sure. Fixed.

@chalasrchalasrforce-pushed thecmd-not-found-listener branch fromca50cf9 tob21ce85CompareMarch 29, 2017 19:37
@chalasr
Copy link
MemberAuthor

Ready, build failure unrelated.

@chalasr
Copy link
MemberAuthor

Bump, it will be harder to make this change after 3.3 (would involve deprecations).

@fabpot
Copy link
Member

Thank you@chalasr.

@fabpotfabpot merged commitb21ce85 intosymfony:masterApr 5, 2017
fabpot added a commit that referenced this pull requestApr 5, 2017
…lasr)This PR was merged into the 3.3-dev branch.Discussion----------[Console] Allow to catch CommandNotFoundException| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#22144 (comment)| License       | MIT| Doc PR        | n/aBasically reverts#22144, making the command argument optional in console.error event instead, so that `CommandNotFoundException` can be handled as any other console error.Commits-------b21ce85 [Console] Allow to catch CommandNotFoundException
@chalasrchalasr deleted the cmd-not-found-listener branchApril 5, 2017 17:08
@fabpotfabpot mentioned this pull requestMay 1, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@lyrixxlyrixxlyrixx left review comments

@wouterjwouterjwouterj left review comments

@xabbuhxabbuhxabbuh approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

7 participants

@chalasr@fabpot@lyrixx@wouterj@xabbuh@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp