Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/Components/GroupKeywordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static function provideExpressions(): Generator

/** @param GroupKeyword|array<GroupKeyword> $component */
#[DataProvider('provideExpressions')]
public function testBuild($component, string $expected): void
public function testBuild(GroupKeyword|array $component, string $expected): void
{
if (is_array($component)) {
$this->assertSame($expected, GroupKeyword::buildAll($component));
Expand Down
3 changes: 1 addition & 2 deletions tests/Lexer/ContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ public function testLoadError(): void
$this->assertFalse(Context::load('Foo'));
}

/** @param int|string $mode */
#[DataProvider('providerForTestMode')]
public function testMode($mode, int $expected): void
public function testMode(int|string $mode, int $expected): void
{
Context::setMode($mode);
$this->assertSame($expected, Context::getMode());
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function getTokensList(string $query): TokensList
* : list<array{string, Token, int}>
* )
*/
public function getErrorsAsArray($obj): array
public function getErrorsAsArray(Lexer|Parser $obj): array
{
$ret = [];
if ($obj instanceof Lexer) {
Expand Down
12 changes: 6 additions & 6 deletions tests/Utils/CLITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function testGetopt(): void

/** @param array<string, bool|string>|false $getopt */
#[DataProvider('highlightParamsProvider')]
public function testRunHighlight($getopt, string $output, int $result): void
public function testRunHighlight(array|false $getopt, string $output, int $result): void
{
$cli = $this->getCLI($getopt);
$this->expectOutputString($output);
Expand Down Expand Up @@ -122,7 +122,7 @@ public static function highlightParamsProvider(): array

/** @param array<string, bool|string>|false $getopt */
#[DataProvider('highlightParamsStdInProvider')]
public function testRunHighlightStdIn(string $input, $getopt, string $output, int $result): void
public function testRunHighlightStdIn(string $input, array|false $getopt, string $output, int $result): void
{
$cli = $this->getCLIStdIn($input, $getopt);
$this->expectOutputString($output);
Expand Down Expand Up @@ -187,7 +187,7 @@ public static function highlightParamsStdInProvider(): array

/** @param array<string, bool|string>|false $getopt */
#[DataProvider('lintParamsStdInProvider')]
public function testRunLintFromStdIn(string $input, $getopt, string $output, int $result): void
public function testRunLintFromStdIn(string $input, array|false $getopt, string $output, int $result): void
{
$cli = $this->getCLIStdIn($input, $getopt);
$this->expectOutputString($output);
Expand Down Expand Up @@ -249,7 +249,7 @@ public static function lintParamsStdInProvider(): array

/** @param array<string, bool|string>|false $getopt */
#[DataProvider('lintParamsProvider')]
public function testRunLint($getopt, string $output, int $result): void
public function testRunLint(array|false $getopt, string $output, int $result): void
{
$cli = $this->getCLI($getopt);
$this->expectOutputString($output);
Expand Down Expand Up @@ -313,7 +313,7 @@ public static function lintParamsProvider(): array

/** @param array<string, bool|string>|false $getopt */
#[DataProvider('tokenizeParamsProvider')]
public function testRunTokenize($getopt, string $output, int $result): void
public function testRunTokenize(array|false $getopt, string $output, int $result): void
{
$cli = $this->getCLI($getopt);
$this->expectOutputString($output);
Expand Down Expand Up @@ -365,7 +365,7 @@ public static function tokenizeParamsProvider(): array

/** @param array<string, bool|string>|false $getopt */
#[DataProvider('tokenizeParamsStdInProvider')]
public function testRunTokenizeStdIn(string $input, $getopt, string $output, int $result): void
public function testRunTokenizeStdIn(string $input, array|false $getopt, string $output, int $result): void
{
$cli = $this->getCLIStdIn($input, $getopt);
$this->expectOutputString($output);
Expand Down