Skip to content

Commit

Permalink
Fix PhpStan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek committed Mar 24, 2020
1 parent cfee7cf commit 33f92d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 2 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ includes:
- vendor/phpstan/phpstan-nette/rules.neon

parameters:
checkGenericClassInNonGenericObjectType: false
checkGenericClassInNonGenericObjectType: false
checkMissingIterableValueType: false
7 changes: 2 additions & 5 deletions src/GitLabApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,7 @@ public function validateToken(string $token): bool
{
$response = $this->request('projects', null, '1 hour', $token);

return (\is_array($response) === false
&& $response->offsetExists('message')
&& $response->message === '401 Unauthorized'
) === false;
return ($response instanceof ApiData && $response->offsetExists('message') && $response->message === '401 Unauthorized') === false;
}


Expand All @@ -295,7 +292,7 @@ private function mapToApiData($haystack)
if ($haystack instanceof \stdClass) {
$return = new ApiData;

foreach ($haystack as $key => $value) {
foreach ((array) $haystack as $key => $value) {
$return->{$key} = $value;
}

Expand Down

0 comments on commit 33f92d4

Please sign in to comment.