Skip to content

Deprecate passing null as $message or $code to exceptions #40288

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

Conversation

derrabus
Copy link
Member

Q A
Branch? 5.x
Bug fix? no
New feature? no
Deprecations? yes
Tickets N/A
License MIT
Doc PR N/A

Follow-up to #40271.

Following the example of the PHP core, this PR introduces deprecation warnings that are triggered if a developer attempts to pass null as $code or $message to an exception constructor.

@stof
Copy link
Member

stof commented Feb 24, 2021

shouldn't we apply the code turning null into 0 to the 4.4 branch already to avoid the PHP deprecation ?

@nicolas-grekas
Copy link
Member

@stof see reasoning in #40271 (comment)

@derrabus derrabus force-pushed the deprecate/nullable-exception-parameters branch from 880d9e3 to dbbbec1 Compare February 24, 2021 13:35
@derrabus derrabus force-pushed the deprecate/nullable-exception-parameters branch from dbbbec1 to 8e3058d Compare February 24, 2021 13:36
@fabpot
Copy link
Member

fabpot commented Feb 25, 2021

Thank you @derrabus.

@fabpot fabpot merged commit b44b9aa into symfony:5.x Feb 25, 2021
@derrabus derrabus deleted the deprecate/nullable-exception-parameters branch February 25, 2021 07:51
@fabpot fabpot mentioned this pull request Apr 18, 2021
derrabus added a commit that referenced this pull request May 20, 2021
This PR was merged into the 5.3 branch.

Discussion
----------

Add missing dependency

| Q             | A
| ------------- | ---
| Branch?       | 5.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Add missing dependency related to #40288

Commits
-------

bd3c1fa Add missing dependency
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