Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Console] Fixed exit code with non-integer throwable code #24951

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 11, 2017

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Nov 13, 2017

Q A
Branch? master
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

The exception/error code in PHP doesn't have to be an integer:

Returns the exception code as integer in Exception but possibly as other type in Exception descendants (for example as string in PDOException).
http://php.net/manual/en/exception.getcode.php#refsect1-exception.getcode-returnvalues

This means that a "Return value of Symfony\Component\Console\Event\ConsoleErrorEvent::getExitCode() must be of the type integer, string returned" error is shown when e.g. an uncatched PDOException is handled by the console error event.

@wouterj wouterj changed the title Fixed exit code with non-integer throwable code [Console] Fixed exit code with non-integer throwable code Nov 13, 2017
@nicolas-grekas
Copy link
Member

For 2.7? Can you add a test case please?

@nicolas-grekas nicolas-grekas added this to the 2.7 milestone Nov 15, 2017
@fabpot
Copy link
Member

fabpot commented Dec 11, 2017

Thank you @wouterj.

@fabpot fabpot merged commit ca86e65 into symfony:master Dec 11, 2017
fabpot added a commit that referenced this pull request Dec 11, 2017
…(wouterj)

This PR was merged into the 4.1-dev branch.

Discussion
----------

[Console] Fixed exit code with non-integer throwable code

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

The exception/error code in PHP doesn't have to be an integer:

 > Returns the exception code as integer in Exception but possibly as other type in Exception descendants (for example as string in PDOException).
> http://php.net/manual/en/exception.getcode.php#refsect1-exception.getcode-returnvalues

This means that a "Return value of Symfony\Component\Console\Event\ConsoleErrorEvent::getExitCode() must be of the type integer, string returned" error is shown when e.g. an uncatched PDOException is handled by the console error event.

Commits
-------

ca86e65 Fixed exit code with non-integer throwable code
@fabpot
Copy link
Member

fabpot commented Dec 11, 2017

merged in master, but cherry-picked in 3.3 as this is a bug fix.

@wouterj wouterj deleted the patch-14 branch December 12, 2017 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants