1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Better docs

This commit is contained in:
Daniil Gentili 2022-11-08 16:00:00 +01:00
parent 3c7e5be703
commit c720e41469
5 changed files with 30 additions and 20 deletions

View File

@ -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

View File

@ -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 &raquo; next to each type to view detailed documentation and examples._
- [object &raquo;](#unnamed-objects)
- [object{foo: string} &raquo;](#object-properties)
- [Exception, Foo\MyClass and Foo\MyClass&lt;Bar&gt; &raquo;](#named-objects)
- [Generator](#generators)
### Unnamed objects

View File

@ -1,5 +1,7 @@
# Scalar types
_Click on the &raquo; next to each type to view detailed documentation and examples._
* [bool &raquo;](scalar_types.md#scalar)
* [int &raquo;](scalar_types.md#scalar)
* [float &raquo;](scalar_types.md#scalar)

View File

@ -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 &raquo; next to each type to view detailed documentation and examples._
- [(T is true ? string : bool) &raquo;](conditional_types.md)
- [`key-of<T>` &raquo;](#key-oft)
- [`value-of<T>` &raquo;](#value-oft)
- [`properties-of<T>` &raquo;](#properties-oft)
- [`class-string-map<T as Foo, T>` &raquo;](#class-string-mapt-as-foo-t)
- [`T[K]` &raquo;](#tk)
- [Type aliases &raquo;](#type-aliases)
- [Variable templates &raquo;](#variable-templates)
## `key-of<T>`

View File

@ -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 &raquo; next to each type to view detailed documentation and examples._
- [null &raquo;](#null)
- [true, false &raquo;](#true-false)
- [6, 7.0, "forty-two" and 'forty two' &raquo;](#some_string-4-314)
- [Foo\Bar::MY_SCALAR_CONST &raquo;](#regular-class-constants)
### null