Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Apply code optimisation
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Mar 9, 2023
1 parent fbe3759 commit 56a837d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Request/BaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,16 @@ abstract class BaseRequest
*/
public function __construct(string $serverKey = null, string $senderId = null)
{
if ($serverKey !== null) {
$this->serverKey = $serverKey;
}

if ($senderId !== null) {
$this->senderId = $senderId;
}

// They may have been already filled
if ($this->serverKey === null || $this->senderId === null) {
$config = app('config')->get('fcm.http', []);
$this->serverKey = $config['server_key'];
$this->senderId = $config['sender_id'];
return;
}

$this->serverKey = $serverKey;
$this->senderId = $senderId;
}

/**
Expand Down

0 comments on commit 56a837d

Please sign in to comment.