Files
provider_imap/lib/Client/Mime/Part/Part.php
Sebastian Krupinski e51c65bf19 feat: initial version
Signed-off-by: Sebastian Krupinski <root@LAPTOP-7DVOR6NC>
2026-02-20 21:44:49 +00:00

36 lines
727 B
PHP

<?php
declare(strict_types=1);
namespace Gricob\IMAP\Mime\Part;
abstract readonly class Part
{
public string $type;
public string $subtype;
/**
* @var array<string, string>
*/
public array $attributes;
/**
* @param array<string,string> $attributes
*/
public function __construct(
string $type,
string $subtype,
array $attributes,
) {
$this->subtype = strtolower($subtype);
$this->type = strtolower($type);
$this->attributes = $attributes;
}
abstract public function findPartByMimeType(string $mimeType): ?SinglePart;
public function mimeType(): string
{
return $this->type.'/'.$this->subtype;
}
}