Skip to content

Commit

Permalink
PHPStan 1.3, Doctrine Coding Standard 9 (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus authored Jan 11, 2022
1 parent 670fdf6 commit 0e39051
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"php": "^7.2 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^8.0",
"phpstan/phpstan": "^0.12",
"doctrine/coding-standard": "^9.0",
"phpstan/phpstan": "1.3",
"phpunit/phpunit": "^8.2 || ^9.4",
"vimeo/psalm": "^4.11"
},
Expand Down
4 changes: 1 addition & 3 deletions lib/Doctrine/Common/Lexer/AbstractLexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ abstract class AbstractLexer
/**
* Composed regex for input parsing.
*
* @var string
* @var string|null
*/
private $regex;

Expand Down Expand Up @@ -215,7 +215,6 @@ public function isA($value, $token)
* Moves the lookahead token forward.
*
* @return mixed[]|null The next token or NULL if there are no more tokens ahead.
*
* @psalm-return array{value: string, type: string|int|null, position: int}|null
*/
public function peek()
Expand All @@ -231,7 +230,6 @@ public function peek()
* Peeks at the next token, returns it and immediately resets the peek.
*
* @return mixed[]|null The next token or NULL if there are no more tokens ahead.
*
* @psalm-return array{value: string, type: string|int|null, position: int}|null
*/
public function glimpse()
Expand Down
5 changes: 5 additions & 0 deletions tests/Doctrine/Common/Lexer/AbstractLexerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public function testResetPosition(): void

/**
* @psalm-param list<array{value: string|int, type: string, position: int}> $expectedTokens
*
* @dataProvider dataProvider
*/
public function testMoveNext(string $input, array $expectedTokens): void
Expand Down Expand Up @@ -172,6 +173,7 @@ public function testUtf8Mismatch(): void

/**
* @psalm-param list<array{value: string|int, type: string, position: int}> $expectedTokens
*
* @dataProvider dataProvider
*/
public function testPeek(string $input, array $expectedTokens): void
Expand All @@ -186,6 +188,7 @@ public function testPeek(string $input, array $expectedTokens): void

/**
* @psalm-param list<array{value: string|int, type: string, position: int}> $expectedTokens
*
* @dataProvider dataProvider
*/
public function testGlimpse(string $input, array $expectedTokens): void
Expand Down Expand Up @@ -225,6 +228,7 @@ public function testGetInputUntilPosition(

/**
* @psalm-param list<array{value: string|int, type: string, position: int}> $expectedTokens
*
* @dataProvider dataProvider
*/
public function testIsNextToken(string $input, array $expectedTokens): void
Expand All @@ -240,6 +244,7 @@ public function testIsNextToken(string $input, array $expectedTokens): void

/**
* @psalm-param list<array{value: string|int, type: string, position: int}> $expectedTokens
*
* @dataProvider dataProvider
*/
public function testIsNextTokenAny(string $input, array $expectedTokens): void
Expand Down

0 comments on commit 0e39051

Please sign in to comment.