25 lines
481 B
PHP
25 lines
481 B
PHP
<?php
|
|
// RefererHeader.php
|
|
// Created: 2022-02-14
|
|
// Updated: 2022-02-27
|
|
|
|
namespace Index\Http\Headers;
|
|
|
|
use Index\Http\HttpHeader;
|
|
|
|
class RefererHeader {
|
|
private string $url;
|
|
|
|
public function __construct(string $url) {
|
|
$this->url = $url;
|
|
}
|
|
|
|
public function getSource(): string {
|
|
return $this->url;
|
|
}
|
|
|
|
public static function parse(HttpHeader $header): RefererHeader {
|
|
return new RefererHeader(trim($header->getFirstLine()));
|
|
}
|
|
}
|