mirror of
https://github.com/danog/psalm.git
synced 2024-12-03 10:07:52 +01:00
Clarify docs
This commit is contained in:
parent
088e4e005f
commit
d6386b9a1f
@ -2,7 +2,7 @@
|
|||||||
## Changed
|
## Changed
|
||||||
|
|
||||||
- [BC] Switched the internal representation of `list<T>` and `non-empty-list<T>` from the TList and TNonEmptyList classes to an unsealed list shape: the TList, TNonEmptyList and TCallableList classes were removed.
|
- [BC] Switched the internal representation of `list<T>` and `non-empty-list<T>` from the TList and TNonEmptyList classes to an unsealed list shape: the TList, TNonEmptyList and TCallableList classes were removed.
|
||||||
Nothing will change for users: `list<T>` and `non-empty-list<T>` syntax will remain supported and its semantics unchanged.
|
Nothing will change for users: the `list<T>` and `non-empty-list<T>` syntax will remain supported and its semantics unchanged.
|
||||||
Psalm 5 already deprecates the `TList`, `TNonEmptyList` and `TCallableList` classes: use `\Psalm\Type::getListAtomic`, `\Psalm\Type::getNonEmptyListAtomic` and `\Psalm\Type::getCallableListAtomic` to instantiate list atomics, or directly instantiate TKeyedArray objects with `is_list=true` where appropriate.
|
Psalm 5 already deprecates the `TList`, `TNonEmptyList` and `TCallableList` classes: use `\Psalm\Type::getListAtomic`, `\Psalm\Type::getNonEmptyListAtomic` and `\Psalm\Type::getCallableListAtomic` to instantiate list atomics, or directly instantiate TKeyedArray objects with `is_list=true` where appropriate.
|
||||||
|
|
||||||
- [BC] The only optional boolean parameter of `TKeyedArray::getGenericArrayType` was removed, and was replaced with a string parameter with a different meaning.
|
- [BC] The only optional boolean parameter of `TKeyedArray::getGenericArrayType` was removed, and was replaced with a string parameter with a different meaning.
|
||||||
|
@ -7,7 +7,7 @@ use Psalm\Type;
|
|||||||
use function array_fill;
|
use function array_fill;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Will be removed in Psalm v6, please use TKeyedArrays with is_list=true instead.
|
* @deprecated Will be removed in Psalm v6, please use TCallableKeyedArrays with is_list=true instead.
|
||||||
*
|
*
|
||||||
* Denotes a list that is _also_ `callable`.
|
* Denotes a list that is _also_ `callable`.
|
||||||
* @psalm-immutable
|
* @psalm-immutable
|
||||||
|
@ -16,6 +16,10 @@ use function get_class;
|
|||||||
/**
|
/**
|
||||||
* @deprecated Will be removed in Psalm v6, please use TKeyedArrays with is_list=true instead.
|
* @deprecated Will be removed in Psalm v6, please use TKeyedArrays with is_list=true instead.
|
||||||
*
|
*
|
||||||
|
* You may also use the \Psalm\Type::getListAtomic shortcut, which creates unsealed list-like shaped arrays
|
||||||
|
* with all elements optional, semantically equivalent to a TList.
|
||||||
|
*
|
||||||
|
*
|
||||||
* Represents an array that has some particularities:
|
* Represents an array that has some particularities:
|
||||||
* - its keys are integers
|
* - its keys are integers
|
||||||
* - they start at 0
|
* - they start at 0
|
||||||
|
@ -10,6 +10,10 @@ use function array_fill;
|
|||||||
/**
|
/**
|
||||||
* @deprecated Will be removed in Psalm v6, please use TKeyedArrays with is_list=true instead.
|
* @deprecated Will be removed in Psalm v6, please use TKeyedArrays with is_list=true instead.
|
||||||
*
|
*
|
||||||
|
* You may also use the \Psalm\Type::getNonEmptyListAtomic shortcut, which creates unsealed list-like shaped arrays
|
||||||
|
* with one non-optional element, semantically equivalent to a TNonEmptyList.
|
||||||
|
*
|
||||||
|
*
|
||||||
* Represents a non-empty list
|
* Represents a non-empty list
|
||||||
* @psalm-immutable
|
* @psalm-immutable
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user