Skip to content

Commit 7dfeaa9

Browse files
committed
Add psalm and phpstan prefixed annotations to param and return group
1 parent fb2caa8 commit 7dfeaa9

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

lib/Doctrine/ruleset.xml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,16 @@
174174
@ODM\,
175175
@PHPCR\,
176176
"/>
177-
<element value="@param"/>
178-
<element value="@return"/>
177+
<element value="
178+
@param,
179+
@psalm-param,
180+
@phpstan-param,
181+
"/>
182+
<element value="
183+
@return,
184+
@psalm-return,
185+
@phpstan-return,
186+
"/>
179187
<element value="@throws"/>
180188
</property>
181189
</properties>

tests/fixed/doc-comment-spacing.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,14 @@ public function c(iterable $foo): void
5656
* @PHPCR\Uuid
5757
* @PHPCR\Field
5858
*
59-
* @param int[] $foo
60-
* @param int[] $bar
59+
* @param int[] $foo
60+
* @param int[] $bar
61+
* @psalm-param array<string, int> $foo
62+
* @phpstan-param array<string, int> $foo
6163
*
62-
* @return int[]
64+
* @return int[]
65+
* @psalm-return array<string, int>
66+
* @phpstan-return array<string, int>
6367
*
6468
* @throws FooException
6569
* @throws BarException

tests/input/doc-comment-spacing.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,24 @@ public function c(iterable $foo): void
4343
* Description
4444
* More Description
4545
* @throws FooException
46-
* @param int[] $foo
46+
* @param int[] $foo
4747
* @uses other
4848
* @throws BarException
49-
* @return int[]
49+
* @return int[]
5050
* @ORM\Id
5151
* @internal
5252
* @link https://example.com
5353
* @ODM\Id
5454
* @deprecated
5555
* @PHPCR\Uuid
56-
* @param int[] $bar
56+
* @param int[] $bar
5757
* @PHPCR\Field
5858
* @ODM\Column
5959
* @ORM\Column
60+
* @psalm-param array<string, int> $foo
61+
* @phpstan-return array<string, int>
62+
* @phpstan-param array<string, int> $foo
63+
* @psalm-return array<string, int>
6064
* @see other
6165
*
6266
*/

0 commit comments

Comments
 (0)