From 2e04aff60f0a351ef84546002a498df86645591a Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 8 Nov 2022 20:34:26 +0100 Subject: [PATCH] Fix docs --- docs/annotating_code/type_syntax/array_types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/annotating_code/type_syntax/array_types.md b/docs/annotating_code/type_syntax/array_types.md index 5e3b1b519e3..66e2c9dced5 100644 --- a/docs/annotating_code/type_syntax/array_types.md +++ b/docs/annotating_code/type_syntax/array_types.md @@ -236,7 +236,7 @@ function avgCoefficient(array $params): float { ``` In this example, we assume that `avg` takes an array with two elements, but what happens if the API (or some other function) also provides a third `c` parameter to a function that averages two elements? -And what would happen if a string `csrf` parameter were provided in `$_POST`? +And what would happen if a string `requestId` parameter is returned by the API call? Clearly, just asserting the shape of the array is not enough: we need to guarantee that the array will contain only the array elements we need.