Skip to content

Commit 516b84f

Browse files
committed
Fix psalm errors
1 parent 44df90a commit 516b84f

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Diff for: composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
}
1818
},
1919
"require-dev": {
20+
"type-lang/parser": "^1.0",
2021
"friendsofphp/php-cs-fixer": "^3.42",
2122
"phpunit/phpunit": "^10.5",
2223
"rector/rector": "^1.0",

Diff for: src/Tag/Content.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace TypeLang\PHPDoc\Tag;
66

7-
use TypeLang\Parser\Exception\ParserExceptionInterface;
87
use TypeLang\Parser\Node\Stmt\TypeStatement;
98
use TypeLang\Parser\ParserInterface as TypesParserInterface;
109
use TypeLang\PHPDoc\Exception\InvalidTagException;
@@ -108,19 +107,20 @@ public function nextOptionalVariable(): ?string
108107
*/
109108
public function nextValue(string $tag, string $value): string
110109
{
110+
/** @var T */
111111
return $this->apply(new ValueApplicator($tag, $value));
112112
}
113113

114114
/**
115115
* @template T of non-empty-string
116116
*
117117
* @api
118-
* @param non-empty-string $tag
119118
* @param T $value
120119
* @return T|null
121120
*/
122121
public function nextOptionalValue(string $value): ?string
123122
{
123+
/** @var T|null */
124124
return $this->apply(new OptionalValueApplicator($value));
125125
}
126126

Diff for: src/Tag/Content/ValueApplicator.php

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public function __construct(
3333
*/
3434
public function __invoke(Content $lexer): string
3535
{
36+
/** @var T */
3637
return ($this->identifier)($lexer)
3738
?? throw $lexer->getTagException(\sprintf(
3839
'Tag @%s contains an incorrect identifier value "%s"',

0 commit comments

Comments
 (0)