From 62ccd1e23f4511a74e794e9bb86125e2e9984a25 Mon Sep 17 00:00:00 2001 From: foaly-nr1 Date: Thu, 20 Apr 2017 14:59:33 +0100 Subject: [PATCH] Require PHP 7.1 --- Services/Email.php | 17 ++++++++--------- composer.json | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Services/Email.php b/Services/Email.php index f2eff66..e335cd5 100644 --- a/Services/Email.php +++ b/Services/Email.php @@ -19,9 +19,8 @@ class Email /** * @param GoogleServices $googleClients */ - public function __construct( - GoogleServices $googleClients - ) { + public function __construct(GoogleServices $googleClients) + { $this->googleServices = $googleClients; } @@ -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; } @@ -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); @@ -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); diff --git a/composer.json b/composer.json index 7fc5899..c8dbd77 100644 --- a/composer.json +++ b/composer.json @@ -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",