Closed inghamn closed 4 years ago
if (!count($response->errors)) {
header('Location: ')...;
}
This particular call is used throughout the controllers. The strict type checking on the responses are catching that the errors are null (and cannot be counted).
We should clean up the response definitions to make clear that the errors may be null. We should update the check for errors in the controllers to a plain truthy check.
if (!$response->errors) {
header('Location: ')...;
}
Older PHP versions would let you get away with this. Now, you can only call count() on something that's countable. In the case of the Adress UpdateController, we're checking for errors. We should just check for the presence of errors, rather than trying to count them (which could be null).