Skip to content

Commit

Permalink
Add psalm and phpstan prefixed annotations to param and return group
Browse files Browse the repository at this point in the history
  • Loading branch information
simonberger authored and greg0ire committed Apr 3, 2021
1 parent 8294297 commit 49386d9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
12 changes: 10 additions & 2 deletions lib/Doctrine/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,16 @@
@ODM\,
@PHPCR\,
"/>
<element value="@param"/>
<element value="@return"/>
<element value="
@param,
@psalm-param,
@phpstan-param,
"/>
<element value="
@return,
@psalm-return,
@phpstan-return,
"/>
<element value="@throws"/>
</property>
</properties>
Expand Down
10 changes: 7 additions & 3 deletions tests/fixed/doc-comment-spacing.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,14 @@ public function c(iterable $foo): void
* @PHPCR\Uuid
* @PHPCR\Field
*
* @param int[] $foo
* @param int[] $bar
* @param int[] $foo
* @param int[] $bar
* @psalm-param array<string, int> $foo
* @phpstan-param array<string, int> $foo
*
* @return int[]
* @return int[]
* @psalm-return array<string, int>
* @phpstan-return array<string, int>
*
* @throws FooException
* @throws BarException
Expand Down
10 changes: 7 additions & 3 deletions tests/input/doc-comment-spacing.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,24 @@ public function c(iterable $foo): void
* Description
* More Description
* @throws FooException
* @param int[] $foo
* @param int[] $foo
* @uses other
* @throws BarException
* @return int[]
* @return int[]
* @ORM\Id
* @internal
* @link https://example.com
* @ODM\Id
* @deprecated
* @PHPCR\Uuid
* @param int[] $bar
* @param int[] $bar
* @PHPCR\Field
* @ODM\Column
* @ORM\Column
* @psalm-param array<string, int> $foo
* @phpstan-return array<string, int>
* @phpstan-param array<string, int> $foo
* @psalm-return array<string, int>
* @see other
*
*/
Expand Down

0 comments on commit 49386d9

Please sign in to comment.