Skip to content

Commit 639b64f

Browse files
authored
Update phpdocs-basics.md
1 parent ddeee12 commit 639b64f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

website/src/writing-php-code/phpdocs-basics.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,13 @@ Generics
216216

217217
PHPDoc tags `@template`, `@template-covariant`, `@extends`, and `@implements` are reserved for generics. [Learn more about generics »](/blog/generics-in-php-using-phpdocs), also check out [Generics By Examples »](/blog/generics-by-examples).
218218

219+
Narrowing types after function call
220+
----------------
221+
222+
<div class="text-xs inline-block border border-green-600 text-green-600 bg-green-100 rounded px-1 mb-4">Available in PHPStan 1.9.0</div>
223+
224+
PHPDoc tags `@phpstan-assert`, `@phpstan-assert-if-true`, `@phpstan-assert-if-false` are used to inform PHPStan about type-narrowing happening inside called functions and methods. [Learn more »](/writing-php-code/narrowing-types#custom-type-checking-functions-and-methods)
225+
219226
Setting parameter type passed by reference
220227
---------------
221228

0 commit comments

Comments
 (0)