Skip to content

Conversation

tspencer244
Copy link

Fixed the following deprecation notice:

"Exception::__construct(): Passing null to parameter #2 ($code) of type int is deprecated"

$this->code = $code ?? $response->getStatusCode();
parent::__construct($message, $code ?? $response->getStatusCode());

parent::__construct($message, $code);
Copy link
Author

Choose a reason for hiding this comment

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

A deprecation notice was emitted If $code is null here.

{
parent::setUp();

$this->withoutDeprecationHandling();
Copy link
Author

Choose a reason for hiding this comment

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

This configures Laravel to let deprecation notices bubble up to the PHPUnit error handler.

@tspencer244 tspencer244 marked this pull request as ready for review June 30, 2025 07:07
Fixed the following deprecation notice:

"Exception::__construct(): Passing null to parameter laravel-notification-channels#2 ($code) of type
int is deprecated"
@tspencer244 tspencer244 force-pushed the fix-exception-deprecation-notice branch from 78c3ed2 to 98e724e Compare June 30, 2025 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant