Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MidnightDesign committed Sep 2, 2024
1 parent 3b4433c commit 8d8ef83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/StructLiteral.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function location(): Span

public function evaluate(Scope $scope): mixed
{
return (object)array_map(static fn(Expression $value) => $value->evaluate($scope), $this->fields);
return (object)array_map(static fn(Expression $value): mixed => $value->evaluate($scope), $this->fields);
}

public function equals(Expression $other): bool
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/Parser/TypeParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use LogicException;
use PHPUnit\Framework\TestCase;

use function assert;
use function explode;
use function implode;
use function preg_match;
Expand Down Expand Up @@ -212,7 +211,7 @@ public function testSyntaxErrors(string $type, string $expectedMessage): void
}
$startCol = strlen($matches['indent']) + 1;
$endCol = strlen($matches['indent']) + strlen($matches['marker']);
assert($endCol > 0, 'End column can\'t be lower than 1 because the marker is at least one character long');
/** @psalm-suppress InvalidArgument False positive */
$expectedSpan = new Span($lineNumber, $startCol, $lineNumber, $endCol);

Check failure on line 215 in tests/unit/Parser/TypeParserTest.php

View workflow job for this annotation

GitHub Actions / PHPStan - 8.3 --prefer-lowest

Parameter #4 $endColumn of class Eventjet\Ausdruck\Parser\Span constructor expects int<1, max>, int<0, max> given.

Check failure on line 215 in tests/unit/Parser/TypeParserTest.php

View workflow job for this annotation

GitHub Actions / PHPStan - 8.2 --prefer-lowest

Parameter #4 $endColumn of class Eventjet\Ausdruck\Parser\Span constructor expects int<1, max>, int<0, max> given.

Check failure on line 215 in tests/unit/Parser/TypeParserTest.php

View workflow job for this annotation

GitHub Actions / PHPStan - 8.1 --prefer-lowest

Parameter #4 $endColumn of class Eventjet\Ausdruck\Parser\Span constructor expects int<1, max>, int<0, max> given.
unset($lines[$lineIndex]);
}
Expand Down

0 comments on commit 8d8ef83

Please sign in to comment.