Skip to content

Commit

Permalink
Require PHP 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
foaly-nr1 committed Apr 20, 2017
1 parent bb56b0c commit 62ccd1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions Services/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ class Email
/**
* @param GoogleServices $googleClients
*/
public function __construct(
GoogleServices $googleClients
) {
public function __construct(GoogleServices $googleClients)
{
$this->googleServices = $googleClients;
}

Expand Down Expand Up @@ -62,14 +61,14 @@ public function list(string $userId, array $options = []): \Google_Service_Gmail
*
* @throws \Google_Service_Exception
*/
public function get(string $userId, string $emailId, array $options = [])
public function get(string $userId, string $emailId, array $options = []): ?\Google_Service_Gmail_Message
{
try {
return $this->googleServices->getGoogleServiceGmailForUserId($userId)->users_messages->get($userId, $emailId, $options);
} catch (\Google_Service_Exception $exception) {
// message does not exist
if ($exception->getCode() === 404) {
return;
return null;
} else {
throw $exception;
}
Expand Down Expand Up @@ -169,10 +168,10 @@ public function sendFromEmail(string $email, \Google_Service_Gmail_Message $mess
*
* @return \Google_Service_Gmail_Message|null
*/
public function trash(string $userId, string $emailId): \Google_Service_Gmail_Message
public function trash(string $userId, string $emailId): ?\Google_Service_Gmail_Message
{
if ($this->get($userId, $emailId)) {
return;
return null;
}

return $this->googleServices->getGoogleServiceGmailForUserId($userId)->users_messages->trash($userId, $emailId);
Expand All @@ -186,10 +185,10 @@ public function trash(string $userId, string $emailId): \Google_Service_Gmail_Me
*
* @return \Google_Service_Gmail_Message|null
*/
public function untrash(string $userId, string $emailId): \Google_Service_Gmail_Message
public function untrash(string $userId, string $emailId): ?\Google_Service_Gmail_Message
{
if ($this->get($userId, $emailId)) {
return;
return null;
}

return $this->googleServices->getGoogleServiceGmailForUserId($userId)->users_messages->untrash($userId, $emailId);
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
],
"require": {
"php": ">=7.0",
"php": ">=7.1",
"symfony/http-foundation": "~2.8|~3.0|~3.1",
"symfony/http-kernel": "~2.8|~3.0|~3.1",
"symfony/config": "~2.8|~3.0|~3.1",
Expand Down

0 comments on commit 62ccd1e

Please sign in to comment.