1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Docs: added callable-array (#4079)

* Docs: added callable-array

* Update array_types.md

* Add non-empty-array
This commit is contained in:
Markus Staab 2020-08-28 20:37:28 +02:00 committed by GitHub
parent 5980ef58dc
commit 58141d44ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -118,3 +118,18 @@ Optional keys can be denoted by a trailing `?`, e.g.:
```php
/** @return array{optional?: string, bar: int} */
```
## Callable arrays
a array holding a callable, like phps native `call_user_func()` and friends supports it:
```php
<?php
$callable = ['myClass', 'aMethod'];
$callable = [$object, 'aMethod'];
```
## non-empty-array
a array which is not allowed to be empty

View File

@ -31,6 +31,7 @@ Atomic types are the basic building block of all type information used in Psalm.
- [list & non-empty-list](array_types.md#lists)
- [list\<string\>](array_types.md#lists)
- [array{foo: int, bar: string}](array_types.md#object-like-arrays)
- [callable-array](array_types.md#callable-array)
## [Callable types](callable_types.md)