diff --git a/src/Http/Controllers/InstagramLoginController.php b/src/Http/Controllers/InstagramLoginController.php index 5df6d30..b72ba80 100644 --- a/src/Http/Controllers/InstagramLoginController.php +++ b/src/Http/Controllers/InstagramLoginController.php @@ -28,17 +28,15 @@ public function index(InstagramApi $instagram) $instagramMedias = []; if (config('statamic.instagram.appId') && config('statamic.instagram.appSecret')) { - try { // dd($instagram); $userProfile = $instagram->getUserProfile(); - if (!$userProfile) { + if (! $userProfile) { $status = InstagramApi::STATUS_NOT_CONNECTED; } else { $status = InstagramApi::STATUS_CONNECTED; $instagramMedias = $instagram->getUserMedia(5); } - } catch (InstagramBasicDisplayException | InstagramException | \Exception $exception) { $error = $exception->getMessage(); $status = InstagramApi::STATUS_HAS_ERROR; @@ -56,7 +54,6 @@ public function index(InstagramApi $instagram) ]); } - /** * @param InstagramApi $instagram * @param Request $request diff --git a/src/Http/Controllers/InstagramLogoutController.php b/src/Http/Controllers/InstagramLogoutController.php index 22d0e74..1197299 100644 --- a/src/Http/Controllers/InstagramLogoutController.php +++ b/src/Http/Controllers/InstagramLogoutController.php @@ -1,22 +1,19 @@ authorize('setup Instagram'); $instagram->logout(); return redirect(route('statamic.cp.nineteen-ig.index')); } - } diff --git a/src/InstagramApi.php b/src/InstagramApi.php index 91103a2..bd9d01a 100644 --- a/src/InstagramApi.php +++ b/src/InstagramApi.php @@ -10,7 +10,6 @@ class InstagramApi { - const STATUS_NOT_CONFIGURED = 'NOT_CONFIGURED'; const STATUS_NOT_CONNECTED = 'NOT_CONNECTED'; const STATUS_HAS_ERROR = 'HAS_ERROR'; @@ -87,11 +86,11 @@ public function refreshToken() : void */ public function getUserProfile() : ? object { - if (!$this->instagram_basic_display || !$this->instagram_basic_display->getAccessToken()) { + if (! $this->instagram_basic_display || ! $this->instagram_basic_display->getAccessToken()) { return null; } - $userProfile = $this->instagram_basic_display->getUserProfile(); + $userProfile = $this->instagram_basic_display->getUserProfile(); if (isset($userProfile->error)) { throw new InstagramException($userProfile->error->message); diff --git a/src/InstagramException.php b/src/InstagramException.php index 28e2dd5..0bc1188 100644 --- a/src/InstagramException.php +++ b/src/InstagramException.php @@ -1,10 +1,7 @@