Skip to content

Commit

Permalink
feat: refactor deleteAccessToken method in GoogleClient
Browse files Browse the repository at this point in the history
tomshaw committed Apr 18, 2024
1 parent 3ce418f commit 1b07e23
Showing 4 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/GoogleClient.php
Original file line number Diff line number Diff line change
@@ -103,9 +103,9 @@ public function setAccessToken(array $accessToken): self
return $this;
}

public function deleteAccessToken(): null
public function deleteAccessToken(): void
{
return $this->getStorage()->delete();
$this->getStorage()->delete();
}

public function isEmpty(): bool
4 changes: 1 addition & 3 deletions src/Storage/DatabaseStorageAdapter.php
Original file line number Diff line number Diff line change
@@ -18,10 +18,8 @@ public function get(): ?GoogleToken
return GoogleToken::where('user_id', auth()->id())->first();
}

public function delete(): null
public function delete(): void
{
GoogleToken::where('user_id', auth()->id())->delete();

return null;
}
}
4 changes: 1 addition & 3 deletions src/Storage/SessionStorageAdapter.php
Original file line number Diff line number Diff line change
@@ -18,10 +18,8 @@ public function get(): ?array
return session()->get(self::SESSION_KEY);
}

public function delete(): null
public function delete(): void
{
session()->forget(self::SESSION_KEY);

return null;
}
}
2 changes: 1 addition & 1 deletion src/Storage/StorageAdapterInterface.php
Original file line number Diff line number Diff line change
@@ -8,5 +8,5 @@ public function set(array $accessToken): self;

public function get(): mixed;

public function delete(): null;
public function delete(): void;
}

0 comments on commit 1b07e23

Please sign in to comment.