Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions src/Exceptions/CouldNotSendNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,19 @@ class CouldNotSendNotification extends \Exception
private $response;

/**
* @param Response $response
* @param string $message
* @param int|null $code
* @param Response $response
* @param string $message
* @param int|null $code
*/
public function __construct(Response $response, string $message, int $code = null)
public function __construct(Response $response, string $message, ?int $code = null)
{
$this->response = $response;
$this->message = $message;
$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.

$this->response = $response;
}

/**
* @param Response $response
* @param Response $response
* @return self
*/
public static function serviceRespondedWithAnError(Response $response)
Expand Down
7 changes: 7 additions & 0 deletions tests/ChannelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@

class ChannelTest extends TestCase
{
protected function setUp(): void
{
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.

}

/** @test */
public function it_can_send_a_notification()
{
Expand Down
2 changes: 2 additions & 0 deletions tests/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class MessageTest extends TestCase
public function setUp(): void
{
parent::setUp();

$this->withoutDeprecationHandling();
$this->message = new WebhookMessage();
}

Expand Down