Skip to content

Commit

Permalink
Psalm level 1 passing -- all required suppression due to dependency i…
Browse files Browse the repository at this point in the history
…ssues outside our control
  • Loading branch information
marcguyer committed Sep 16, 2021
1 parent ec26464 commit 5640b45
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 14 deletions.
2 changes: 1 addition & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<psalm
errorLevel="2"
errorLevel="1"
cacheDirectory="data/cache/.psalm_cache"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
Expand Down
17 changes: 12 additions & 5 deletions src/Data/Entity/OAuthAccessToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ public function getIdentifier(): string
return $this->getToken();
}

public function setIdentifier(mixed $identifier): self
/** @psalm-suppress MixedArgument */
public function setIdentifier($identifier): self
{
return $this->setToken($identifier);
}
Expand Down Expand Up @@ -163,14 +164,20 @@ public function removeScope(OAuthScope $scope): self
return $this;
}

public function getScopes(?Criteria $criteria = null): Collection
/** @psalm-suppress MixedInferredReturnType */
public function getScopes(?Criteria $criteria = null): array
{
if ($criteria === null) {
return $this->scopes;
/** @psalm-suppress MixedReturnTypeCoercion */
return $this->scopes->toArray();
}

/** @psalm-suppress UndefinedInterfaceMethod */
return $this->scopes->matching($criteria);
/**
* @psalm-suppress UndefinedInterfaceMethod
* @psalm-suppress MixedReturnStatement
* @psalm-suppress MixedMethodCall
*/
return $this->scopes->matching($criteria)->toArray();
}

public function setExpiresDatetime(\DateTimeImmutable $expiresDatetime): self
Expand Down
18 changes: 14 additions & 4 deletions src/Data/Entity/OAuthAuthCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public function getIdentifier(): ?int

public function setIdentifier(mixed $identifier): self
{
/** @psalm-suppress MixedArgument */
$this->setId($identifier);

return $this;
Expand Down Expand Up @@ -132,14 +133,23 @@ public function removeScope(OAuthScope $scope): self
return $this;
}

public function getScopes(?Criteria $criteria = null): Collection
/**
* @psalm-suppress MixedInferredReturnType
* @psalm-suppress MixedReturnTypeCoercion
*/
public function getScopes(?Criteria $criteria = null): array
{
if ($criteria === null) {
return $this->scopes;
/** @psalm-suppress MixedReturnStatement */
return $this->scopes->toArray();
}

/** @psalm-suppress UndefinedInterfaceMethod */
return $this->scopes->matching($criteria);
/**
* @psalm-suppress UndefinedInterfaceMethod
* @psalm-suppress MixedReturnStatement
* @psalm-suppress MixedMethodCall
*/
return $this->scopes->matching($criteria)->toArray();
}

public function setExpiresDatetime(DateTimeImmutable $expiresDatetime): self
Expand Down
1 change: 1 addition & 0 deletions src/Data/Entity/OAuthClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public function setDetails(array $details): self
return $this;
}

/** @psalm-suppress MixedReturnTypeCoercion */
public function getDetails(): array
{
return $this->details;
Expand Down
16 changes: 13 additions & 3 deletions src/Data/Entity/OAuthScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,17 @@ public function removeAccessToken(OAuthAccessToken $accessToken): self
return $this;
}

/** @psalm-suppress MixedInferredReturnType */
public function getAccessTokens(?Criteria $criteria = null): Collection
{
if ($criteria === null) {
return $this->accessTokens;
}

/** @psalm-suppress UndefinedInterfaceMethod */
/**
* @psalm-suppress UndefinedInterfaceMethod
* @psalm-suppress MixedReturnStatement
*/
return $this->accessTokens->matching($criteria);
}

Expand All @@ -109,16 +113,22 @@ public function removeAuthCode(OAuthAuthCode $authCode): self
{
$this->authCodes->removeElement($authCode);

/** @psalm-suppress MixedInferredReturnType */
return $this;
}

/** @psalm-suppress MixedInferredReturnType */
public function getAuthCodes(?Criteria $criteria = null): Collection
{
if ($criteria === null) {
/** @psalm-suppress MixedInferredReturnType */
return $this->authCodes;
}

/** @psalm-suppress UndefinedInterfaceMethod */
/**
* @psalm-suppress UndefinedInterfaceMethod
* @psalm-suppress MixedReturnStatement
*/
return $this->authCodes->matching($criteria);
}
}
}
4 changes: 3 additions & 1 deletion src/Data/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ public function setDetails(array $details): self
return $this;
}

/** @psalm-suppress MixedReturnTypeCoercion */
public function getDetails(): array
{
/** @psalm-suppress MixedReturnTypeCoercion */
return $this->details;
}
}
}

0 comments on commit 5640b45

Please sign in to comment.