Skip to content

Commit

Permalink
DevKit updates (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI committed Feb 5, 2022
1 parent 265423a commit b6a1c6a
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions CONTRIBUTING.md
Expand Up @@ -94,19 +94,23 @@ Please note that we try to keep phpdoc to a minimum, so if an `@param` phpdoc
comment brings nothing more than the type hint and variable name already do,
it SHOULD be removed. Descriptions are OPTIONAL if you want to document a type.

If you want to use pseudo-types, generics, array shapes or templates for
static-analysis, prefer the usage of `@phpstan-` annotations over classic
annotations to keep IDE support, and over `@psalm-` annotations for consistency.
Keep standard annotations if necessary.
If you want to use templates for static-analysis, prefer the usage of
`@phpstan-` annotations over classic annotations to keep IDE support, and
over `@psalm-` annotations for consistency. Keep standard annotations if necessary.

```php
/**
* @param Bar|Baz $foo
* @param int $limit a crucial, highly interesting comment
* @param Bar|Baz $foo
* @param class-string $class
* @param int $limit a crucial, fascinating comment
*
* @phpstan-param class-string $class
* @return object
*
* @phpstan-template T of object
* @phpstan-param class-string<T> $class
* @phpstan-return T
*/
protected function bar($foo, string $class, int $limit)
protected function bar($foo, string $class, int $limit): object
{
// ...
}
Expand Down

0 comments on commit b6a1c6a

Please sign in to comment.