Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last-minute docufix #8685

Merged
merged 1 commit into from Nov 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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