Skip to content

Commit

Permalink
Don't ignore MissingImmutableAnnotation in Psalm globally
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich committed Nov 13, 2021
1 parent b4832be commit 9fde8ea
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 0 additions & 2 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
</projectFiles>

<issueHandlers>
<MissingImmutableAnnotation errorLevel="suppress" />

<NullableReturnStatement errorLevel="suppress" />
<InvalidNullableReturnType errorLevel="suppress" />

Expand Down
3 changes: 3 additions & 0 deletions src/Reflection/Adapter/ReflectionNamedType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
use ReflectionNamedType as CoreReflectionNamedType;
use Roave\BetterReflection\Reflection\ReflectionNamedType as BetterReflectionNamedType;

/**
* @psalm-suppress MissingImmutableAnnotation
*/
final class ReflectionNamedType extends CoreReflectionNamedType
{
public function __construct(private BetterReflectionNamedType $betterReflectionType)
Expand Down
3 changes: 3 additions & 0 deletions src/Reflection/Adapter/ReflectionParameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

use function array_map;

/**
* @psalm-suppress MissingImmutableAnnotation
*/
final class ReflectionParameter extends CoreReflectionParameter
{
public function __construct(private BetterReflectionParameter $betterReflectionParameter)
Expand Down
4 changes: 4 additions & 0 deletions src/Reflection/Adapter/ReflectionProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ public function hasType(): bool
return $this->betterReflectionProperty->hasType();
}

/**
* @psalm-mutation-free
*/
public function getType(): ReflectionUnionType|ReflectionNamedType|ReflectionIntersectionType|null
{
/** @psalm-suppress ImpureMethodCall */
return ReflectionType::fromTypeOrNull($this->betterReflectionProperty->getType());
}

Expand Down

0 comments on commit 9fde8ea

Please sign in to comment.