Skip to content

Commit

Permalink
WordPress docblock test
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed May 29, 2023
1 parent 4e3883b commit e560a3e
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/PHPStan/Parser/PhpDocParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,38 @@ public function provideParamTagsData(): Iterator
),
]),
];

yield [
'Ok Wordpress @param tag',
'/**' . PHP_EOL .
' * @param array $parameters {' . PHP_EOL .
' * Optional. Parameters for filtering the list of user assignments. Default empty array.' . PHP_EOL .
' *' . PHP_EOL .
' * @type bool $is_active Pass `true` to only return active user assignments and `false` to' . PHP_EOL .
' * return inactive user assignments.' . PHP_EOL .
' * @type DateTime|string $updated_since Only return user assignments that have been updated since the given' . PHP_EOL .
' * date and time.' . PHP_EOL .
' * }' . PHP_EOL .
' */',
new PhpDocNode([
new PhpDocTagNode(
'@param',
new ParamTagValueNode(
new IdentifierTypeNode('array'),
false,
'$parameters',
'{' . PHP_EOL .
' Optional. Parameters for filtering the list of user assignments. Default empty array.'
)
),
new PhpDocTextNode(''),
new PhpDocTagNode('@type', new GenericTagValueNode('bool $is_active Pass `true` to only return active user assignments and `false` to' . PHP_EOL .
' return inactive user assignments.')),
new PhpDocTagNode('@type', new GenericTagValueNode('DateTime|string $updated_since Only return user assignments that have been updated since the given' . PHP_EOL .
' date and time.' . PHP_EOL .
'}')),
]),
];
}

public function provideTypelessParamTagsData(): Iterator
Expand Down

0 comments on commit e560a3e

Please sign in to comment.