Skip to content

Commit 2e73ac5

Browse files
committed
unify coding style with phpstan (2)
1 parent 687d002 commit 2e73ac5

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

src/Ast/PhpDoc/InvalidTagValueNode.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Parser\ParserException;
6-
75
class InvalidTagValueNode implements PhpDocTagValueNode
86
{
97

108
/** @var string (may be empty) */
119
public $value;
1210

13-
/** @var ParserException */
11+
/** @var \PHPStan\PhpDocParser\Parser\ParserException */
1412
public $exception;
1513

16-
public function __construct(string $value, ParserException $exception)
14+
public function __construct(string $value, \PHPStan\PhpDocParser\Parser\ParserException $exception)
1715
{
1816
$this->value = $value;
1917
$this->exception = $exception;

src/Ast/PhpDoc/PhpDocNode.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public function getTags(): array
3131

3232

3333
/**
34+
* @param string $tagName
3435
* @return PhpDocTagNode[]
3536
*/
3637
public function getTagsByName(string $tagName): array

src/Lexer/Lexer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Lexer
7676
/** @var null|string */
7777
private $regexp;
7878

79-
/** @var null|array */
79+
/** @var null|int[] */
8080
private $types;
8181

8282
public function tokenize(string $s): array

src/Parser/PhpDocParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private function parseTagValue(TokenIterator $tokens, string $tag): Ast\PhpDoc\P
109109

110110
$tokens->dropSavePoint();
111111

112-
} catch (ParserException $e) {
112+
} catch (\PHPStan\PhpDocParser\Parser\ParserException $e) {
113113
$tokens->rollback();
114114
$tagValue = new Ast\PhpDoc\InvalidTagValueNode($this->parseOptionalDescription($tokens), $e);
115115
}

src/Parser/TokenIterator.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class TokenIterator
88
{
99

10-
/** @var array */
10+
/** @var mixed[][] */
1111
private $tokens;
1212

1313
/** @var int */
@@ -75,7 +75,8 @@ public function isCurrentTokenType(int $tokenType): bool
7575

7676

7777
/**
78-
* @throws ParserException
78+
* @param int $tokenType
79+
* @throws \PHPStan\PhpDocParser\Parser\ParserException
7980
*/
8081
public function consumeTokenType(int $tokenType)
8182
{
@@ -168,11 +169,12 @@ public function rollback()
168169

169170

170171
/**
171-
* @throws ParserException
172+
* @param int $expectedTokenType
173+
* @throws \PHPStan\PhpDocParser\Parser\ParserException
172174
*/
173175
private function throwError(int $expectedTokenType)
174176
{
175-
throw new ParserException(
177+
throw new \PHPStan\PhpDocParser\Parser\ParserException(
176178
$this->currentTokenValue(),
177179
$this->currentTokenType(),
178180
$this->currentTokenOffset(),

src/Parser/TypeParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private function tryParseArray(TokenIterator $tokens, Ast\Type\TypeNode $type):
121121
$type = new Ast\Type\ArrayTypeNode($type);
122122
}
123123

124-
} catch (ParserException $e) {
124+
} catch (\PHPStan\PhpDocParser\Parser\ParserException $e) {
125125
$tokens->rollback();
126126
}
127127

0 commit comments

Comments
 (0)