Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
RhysLees committed Jan 30, 2025
1 parent 993622c commit 365440f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
Empty file added phpstan-baseline.neon
Empty file.
12 changes: 12 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
includes:
- phpstan-baseline.neon

parameters:
level: 4
paths:
- src
- config
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true

1 change: 1 addition & 0 deletions src/Actions/InstagramHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static function connector(): InstagramConnector
if ($authenticator->hasExpired()) {
$authenticator = $connector->refreshAccessToken($authenticator);

// @phpstan-ignore-next-line
Cache::store(config('instagram.cache_store'))->put('instagram.authenticator', $authenticator->serialize(), now()->addDays(60));
}

Expand Down
4 changes: 2 additions & 2 deletions src/Http/Controllers/InstagramController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public function callback(Request $request)

$connector = new InstagramConnector;
$shortLivedAuthenticator = $connector->getShortLivedAccessToken(code: $request->get('code'));
$authenticator = $connector->getAccessToken(code: $shortLivedAuthenticator->accessToken);
$serialized = $authenticator->serialize();
$authenticator = $connector->getAccessToken(code: $shortLivedAuthenticator->accessToken); // @phpstan-ignore-line
$serialized = $authenticator->serialize(); // @phpstan-ignore-line

Cache::store(config('instagram.cache_store'))->put('instagram.authenticator', $serialized, now()->addDays(60));

Expand Down
4 changes: 1 addition & 3 deletions src/Requests/Authentication/GetAccessTokenRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ public function __construct(protected string $code, protected OAuthConfig $oauth
*
* @return array{
* grant_type: string,
* code: string,
* client_id: string,
* access_token: string,
* client_secret: string,
* redirect_uri: string,
* }
*/
public function defaultQuery(): array
Expand Down

0 comments on commit 365440f

Please sign in to comment.