Final Class Yiisoft\HttpMiddleware\HttpCache\ETagProvider\PredefinedETagProvider
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
Provides {@see ETag} from a predefined collection. Useful for testing purposes.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| get() | Yiisoft\ |
Method Details
| public mixed __construct ( iterable $tags ) | ||
| $tags | iterable |
Predefined {@see \ |
public function __construct(iterable $tags)
{
$this->iterator = $this->createIterator($tags);
}
| public Yiisoft\ | ||
| $request | \ |
|
public function get(ServerRequestInterface $request): ETag
{
if (!$this->iterator->valid()) {
throw new OutOfBoundsException('No more tags available.');
}
/** @var ETag $eTag */
$eTag = $this->iterator->current();
$this->iterator->next();
return $eTag;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.