index/src/Http/Headers/PragmaHeader.php

25 lines
508 B
PHP
Raw Normal View History

2022-09-13 13:13:11 +00:00
<?php
// PragmaHeader.php
// Created: 2022-02-14
// Updated: 2022-02-14
namespace Index\Http\Headers;
use Index\Http\HttpHeader;
class PragmaHeader {
private bool $noCache;
public function __construct(bool $noCache) {
$this->noCache = $noCache;
}
public function shouldByPassCache(): bool {
return $this->noCache;
}
public static function parse(HttpHeader $header): PragmaHeader {
return new PragmaHeader($header->getFirstLine() === 'no-cache');
}
}