Skip to content

Commit

Permalink
Merge pull request #141 from lucasmichot/feature/null-coalescencing
Browse files Browse the repository at this point in the history
Use the null coalescing operator when possible.
  • Loading branch information
Alexandru Bucur committed Mar 8, 2021
2 parents 2b6567c + 6c27bd5 commit 04f7de2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/MessageBird/Common/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function addHttpOption($option, $value)
*/
public function getHttpOption($option)
{
return isset($this->httpOptions[$option]) ? $this->httpOptions[$option] : null;
return $this->httpOptions[$option] ?? null;
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/MessageBird/Objects/SignedRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ public static function createFromGlobals()
$queryParameters = $_GET;
$requestTimestamp = isset($_SERVER['HTTP_MESSAGEBIRD_REQUEST_TIMESTAMP']) ?
(int)$_SERVER['HTTP_MESSAGEBIRD_REQUEST_TIMESTAMP'] : null;
$signature = isset($_SERVER['HTTP_MESSAGEBIRD_SIGNATURE']) ?
$_SERVER['HTTP_MESSAGEBIRD_SIGNATURE'] : null;
$signature = $_SERVER['HTTP_MESSAGEBIRD_SIGNATURE'] ?? null;

$signedRequest = new SignedRequest();
$signedRequest->loadFromArray(compact('body', 'queryParameters', 'requestTimestamp', 'signature'));
Expand Down

0 comments on commit 04f7de2

Please sign in to comment.