Skip to content

Commit

Permalink
add PHPDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
warcooft committed Sep 13, 2024
1 parent b89edde commit 7207536
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/Libraries/MicrosoftOAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

declare(strict_types=1);

/**
* This file is part of Shield OAuth.
*
* (c) Datamweb <[email protected]>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace Datamweb\ShieldOAuth\Libraries;

use CodeIgniter\HTTP\CURLRequest;
Expand Down Expand Up @@ -52,7 +61,7 @@ public function makeGoLink(string $state): string
/**
* @param array<string, string> $allGet
*/
public function fetchAccessTokenWithAuthCode(array $allGet): void
protected function fetchAccessTokenWithAuthCode(array $allGet): void
{
try {
$response = $this->client->request('POST', self::$API_TOKEN_URL, [
Expand All @@ -77,7 +86,7 @@ public function fetchAccessTokenWithAuthCode(array $allGet): void
$this->setToken($token);
}

public function fetchUserInfoWithToken(): object
protected function fetchUserInfoWithToken(): object
{
try {
$response = $this->client->request('GET', self::$API_USER_INFO_URL, [
Expand All @@ -99,7 +108,16 @@ public function fetchUserInfoWithToken(): object
return $userInfo;
}

public function setColumnsName(string $nameOfProcess, object $userInfo): array
/**
* Sets the column names and values based on the process name.
*
* @param string $nameOfProcess The name of the process, such as 'syncingUserInfo' or 'newUser'.
* @param object $userInfo An object containing user information, such as 'givenName', 'surname', and 'mail'.
* This object should be of type `object<string, mixed>`, where the keys represent user attributes.
*
* @return array<int|string, mixed> Returns an associative array mapping column names to their corresponding values.
*/
protected function setColumnsName(string $nameOfProcess, object $userInfo): array
{
if ($nameOfProcess === 'syncingUserInfo') {
return [
Expand Down

0 comments on commit 7207536

Please sign in to comment.