Maybe instead of two loops over etags call:
```php
$preconditionFailed = false;
foreach ($request->getEtags() as $etag) {
    if ($this->getEtag() === $etag || '*' === $etag) {
        $preconditionFailed = true;
        break;
    }
}