mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Better docs
This commit is contained in:
parent
3c7e5be703
commit
c720e41469
@ -25,15 +25,17 @@ PHP treats all these arrays the same, essentially (though there are some optimis
|
||||
|
||||
Psalm has a few different ways to represent arrays in its type system:
|
||||
|
||||
- [array<int, string>](#generic-arrays)
|
||||
- [non-empty-array](#non-empty-array)
|
||||
- [string\[\]](#phpdoc-syntax)
|
||||
- [list & non-empty-list](#lists)
|
||||
_Click on the » next to each type to view detailed documentation and examples._
|
||||
|
||||
- [array<int, string> »](#generic-arrays)
|
||||
- [non-empty-array »](#non-empty-array)
|
||||
- [string\[\] »](#phpdoc-syntax)
|
||||
- [list & non-empty-list »](#lists)
|
||||
- [list<string>](#lists)
|
||||
- [array{foo: int, bar: string} and list{int, string} »](#object-like-arrays)
|
||||
- [Sealed arrays »](#sealed-object-like-arrays)
|
||||
- [Unsealed arrays »](#unsealed-object-like-arrays)
|
||||
- [callable-array](#callable-arrays)
|
||||
- [callable-array »](#callable-arrays)
|
||||
|
||||
## Generic arrays
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
# Object types
|
||||
|
||||
- [object](#unnamed-objects)
|
||||
- [object{foo: string}](#object-properties)
|
||||
- [Exception, Foo\MyClass and Foo\MyClass<Bar>](#named-objectsmd)
|
||||
_Click on the » next to each type to view detailed documentation and examples._
|
||||
|
||||
- [object »](#unnamed-objects)
|
||||
- [object{foo: string} »](#object-properties)
|
||||
- [Exception, Foo\MyClass and Foo\MyClass<Bar> »](#named-objects)
|
||||
- [Generator](#generators)
|
||||
|
||||
### Unnamed objects
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Scalar types
|
||||
|
||||
_Click on the » next to each type to view detailed documentation and examples._
|
||||
|
||||
* [bool »](scalar_types.md#scalar)
|
||||
* [int »](scalar_types.md#scalar)
|
||||
* [float »](scalar_types.md#scalar)
|
||||
|
@ -2,14 +2,16 @@
|
||||
|
||||
Psalm supports some _magical_ utility types that brings superpower to the PHP type system.
|
||||
|
||||
- [(T is true ? string : bool)](conditional_types.md)
|
||||
- [`key-of<T>`](#key-oft)
|
||||
- [`value-of<T>`](#value-oft)
|
||||
- [`properties-of<T>`](#properties-oft)
|
||||
- [`class-string-map<T as Foo, T>`](#class-string-mapt-as-foo-t)
|
||||
- [`T[K]`](#tk)
|
||||
- [Type aliases](#type-aliases)
|
||||
- [Variable templates](#variable-templates)
|
||||
_Click on the » next to each type to view detailed documentation and examples._
|
||||
|
||||
- [(T is true ? string : bool) »](conditional_types.md)
|
||||
- [`key-of<T>` »](#key-oft)
|
||||
- [`value-of<T>` »](#value-oft)
|
||||
- [`properties-of<T>` »](#properties-oft)
|
||||
- [`class-string-map<T as Foo, T>` »](#class-string-mapt-as-foo-t)
|
||||
- [`T[K]` »](#tk)
|
||||
- [Type aliases »](#type-aliases)
|
||||
- [Variable templates »](#variable-templates)
|
||||
|
||||
## `key-of<T>`
|
||||
|
||||
|
@ -2,10 +2,12 @@
|
||||
|
||||
Psalm also allows you to specify values in types.
|
||||
|
||||
- [null](#null)
|
||||
- [true, false](#true-false)
|
||||
- [6, 7.0, "forty-two" and 'forty two'](#some_string-4-314)
|
||||
- [Foo\Bar::MY_SCALAR_CONST](#regular-class-constants)
|
||||
_Click on the » next to each type to view detailed documentation and examples._
|
||||
|
||||
- [null »](#null)
|
||||
- [true, false »](#true-false)
|
||||
- [6, 7.0, "forty-two" and 'forty two' »](#some_string-4-314)
|
||||
- [Foo\Bar::MY_SCALAR_CONST »](#regular-class-constants)
|
||||
|
||||
### null
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user