Skip to content

Commit

Permalink
Merge pull request #8685 from Nicelocal/merge_4.x_final
Browse files Browse the repository at this point in the history
Last-minute docufix
  • Loading branch information
orklah committed Nov 8, 2022
2 parents 33c2d9d + 2e04aff commit 65c31ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/annotating_code/type_syntax/array_types.md
Expand Up @@ -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.

Expand Down

0 comments on commit 65c31ce

Please sign in to comment.