From 832bafa2cc09f9f26ddf23ad9674dc0052d0064c Mon Sep 17 00:00:00 2001 From: MoeBrowne Date: Mon, 30 Sep 2019 22:45:21 +0100 Subject: [PATCH 1/3] Adds Laravel 6 as a Composer requirement --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 9ef0f47..a40fff4 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "php": ">= 5.6.4", "aws/aws-sdk-php-laravel": "^3.1", "nesbot/carbon": "~1.20", - "laravel/framework": "^5.7.0" + "laravel/framework": "^5.7.0 | ^6.0.0" }, "autoload": { "psr-0": { From 322fcf946d3db0659725d18cb50166fd63e5f698 Mon Sep 17 00:00:00 2001 From: MoeBrowne Date: Mon, 30 Sep 2019 22:46:41 +0100 Subject: [PATCH 2/3] Replaces usages of array_ helper functions --- src/AwsCognitoIdentityGuard.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/AwsCognitoIdentityGuard.php b/src/AwsCognitoIdentityGuard.php index 70013a4..f56fa7e 100644 --- a/src/AwsCognitoIdentityGuard.php +++ b/src/AwsCognitoIdentityGuard.php @@ -18,6 +18,7 @@ use Illuminate\Contracts\Cookie\QueueingFactory as CookieJar; use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Session\Session; +use Illuminate\Support\Arr; use Illuminate\Support\Str; use RuntimeException; use Symfony\Component\HttpFoundation\Request; @@ -548,8 +549,8 @@ protected function storeCognitoTokensInSession(array $tokens) protected function attemptCognitoAuthentication(array $credentials) { if ( - !$username = array_get($credentials, $this->config['username-attribute']) OR - !$password = array_get($credentials, 'password') + !$username = Arr::get($credentials, $this->config['username-attribute']) OR + !$password = Arr::get($credentials, 'password') ) { return new AuthAttempt(false); } @@ -830,7 +831,7 @@ public function getLastAttempted() */ public function getCognitoAccessToken() { - return array_get($this->cognitoTokens, 'AccessToken'); + return Arr::get($this->cognitoTokens, 'AccessToken'); } /** @@ -840,7 +841,7 @@ public function getCognitoAccessToken() */ public function getCognitoIdToken() { - return array_get($this->cognitoTokens, 'IdToken'); + return Arr::get($this->cognitoTokens, 'IdToken'); } /** @@ -850,7 +851,7 @@ public function getCognitoIdToken() */ public function getCognitoRefreshToken() { - return array_get($this->cognitoTokens, 'RefreshToken'); + return Arr::get($this->cognitoTokens, 'RefreshToken'); } /** @@ -861,7 +862,7 @@ public function getCognitoRefreshToken() */ public function getCognitoTokensExpiryTime() { - return array_get($this->cognitoTokens, 'ExpiresIn'); + return Arr::get($this->cognitoTokens, 'ExpiresIn'); } /** @@ -871,7 +872,7 @@ public function getCognitoTokensExpiryTime() */ public function getCognitoRefreshTokenExpiryTime() { - return array_get($this->cognitoTokens, 'RefreshTokenExpires'); + return Arr::get($this->cognitoTokens, 'RefreshTokenExpires'); } /** From ef53f5746d757559e62c7fef47a101f502f55743 Mon Sep 17 00:00:00 2001 From: MoeBrowne Date: Mon, 30 Sep 2019 22:52:09 +0100 Subject: [PATCH 3/3] Upgrades the required version of Carbon --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a40fff4..4ff9917 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "require": { "php": ">= 5.6.4", "aws/aws-sdk-php-laravel": "^3.1", - "nesbot/carbon": "~1.20", + "nesbot/carbon": "^2.0.0", "laravel/framework": "^5.7.0 | ^6.0.0" }, "autoload": {