Skip to content

Commit

Permalink
fix static analysis build
Browse files Browse the repository at this point in the history
Signed-off-by: azjezz <[email protected]>
  • Loading branch information
azjezz committed Aug 12, 2021
1 parent 4895e61 commit 3d4b50f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/Psl/RandomSequence/Internal/MersenneTwisterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
trait MersenneTwisterTrait
{
/**
* @var array<int, int>
* @var non-empty-array<int, int>
*/
private array $state;

Expand Down Expand Up @@ -50,8 +50,10 @@ final public function next(): int
$state[$i] = $this->twist($state[$i + 397], $state[$i], $state[$i + 1]);
}
for (; $i < 623; $i++) {
/** @psalm-suppress PossiblyInvalidArrayOffset */
$state[$i] = $this->twist($state[$i - 227], $state[$i], $state[$i + 1]);
}
/** @psalm-suppress InvalidArrayOffset */
$state[623] = $this->twist($state[396], $state[623], $state[0]);
$this->state = $state;

Expand Down
1 change: 1 addition & 0 deletions src/Psl/Regex/every_match.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ static function () use ($subject, $pattern, $offset): ?array {
$capture_groups ??= Type\dict(Type\array_key(), Type\string());

try {
/** @psalm-suppress InvalidArgument */
return Type\vec($capture_groups)->coerce($matching);
} catch (InvariantViolationException | Type\Exception\CoercionException $e) {
throw new Exception\RuntimeException('Invalid capture groups', 0, $e);
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Psl\Type\Exception\TypeTrace;

/**
* @template T
* @template-covariant T
*
* @implements TypeInterface<T>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/TypeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Psl\Type\Exception\TypeTrace;

/**
* @template T
* @template-covariant T
*/
interface TypeInterface
{
Expand Down

0 comments on commit 3d4b50f

Please sign in to comment.