You can simplify this and the following lines to

```
if (isset($value['hour']) && !ctype_digit((string) $value['hour'])) {
```