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:
parent
5980ef58dc
commit
58141d44ed
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user