Skip to content
Permalink
Browse files

Add sample for optional keys in array shapes (#2538)

  • Loading branch information
mfn authored and muglug committed Jan 1, 2020
1 parent 086d141 commit 270a99f57ddbdb1d258c2c52485c0626634da374
Showing with 6 additions and 0 deletions.
  1. +6 −0 docs/annotating_code/type_syntax/array_types.md
@@ -107,3 +107,9 @@ You can specify types in that format yourself, e.g.
```php
/** @return array{foo: string, bar: int} */
```

Optional keys can be denoted by a trailing `?`, e.g.:

```php
/** @return array{optional?: string, bar: int} */
```

0 comments on commit 270a99f

Please sign in to comment.
You can’t perform that action at this time.