Skip to content

Commit

Permalink
Add new alias.
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed May 8, 2019
1 parent 34a155b commit cbe651b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,22 @@ public static function make(?string $clientId, ?string $clientSecret)
* @param string $accessToken
*
* @return static
*
* @see static::fromAccessToken()
*/
public static function personal(string $accessToken)
{
return static::fromAccessToken($accessToken);
}

/**
* Make a client using personal access token.
*
* @param string $accessToken
*
* @return static
*/
public static function fromAccessToken(string $accessToken)
{
return static::make(null, null)->setAccessToken($accessToken);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Katsana\Sdk\Tests;

use Mockery as m;
use Katsana\Sdk\Client;
use Laravie\Codex\Discovery;
use Laravie\Codex\Testing\Faker;
use Mockery as m;

class ClientTest extends TestCase
{
Expand Down

0 comments on commit cbe651b

Please sign in to comment.