Skip to content

Commit

Permalink
Update phpdoc-types.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Apr 18, 2021
1 parent ebf658b commit c9007d4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion website/src/writing-php-code/phpdoc-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Other advanced string types

There's also `callable-string` and `numeric-string`.

Type aliases
Global type aliases
-------------------------

Type aliases (also known as `typedef`) are a popular feature in other languages like TypeScript or C++. Defining type aliases will allow you to reference complex types in your PHPDocs by their alias.
Expand All @@ -152,6 +152,11 @@ function foo($arg)
}
```

Local type aliases
-------------------------

<div class="text-xs inline-block border border-green-600 text-green-600 bg-green-100 rounded px-1 mb-4">Available in PHPStan 0.12.84</div>

You can also define and use local aliases in PHPDocs using the `@phpstan-type` annotation. These are scoped to the class that defines them:

```php
Expand Down

0 comments on commit c9007d4

Please sign in to comment.