index/src/Http/Headers/FromHeader.php

25 lines
479 B
PHP

<?php
// FromHeader.php
// Created: 2022-02-14
// Updated: 2022-02-27
namespace Index\Http\Headers;
use Index\Http\HttpHeader;
class FromHeader {
private string $email;
public function __construct(string $email) {
$this->email = $email;
}
public function getEMailAddress(): string {
return $this->email;
}
public static function parse(HttpHeader $header): FromHeader {
return new FromHeader($header->getFirstLine());
}
}