generated from Nodarx/template
feat: initial version
Signed-off-by: Sebastian Krupinski <root@LAPTOP-7DVOR6NC>
This commit was merged in pull request #1.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Gricob\IMAP\Protocol\Response\Line\Data\Fetch\BodyStructure;
|
||||
|
||||
final readonly class Disposition
|
||||
{
|
||||
/**
|
||||
* @param array<string, string> $attributes
|
||||
*/
|
||||
public function __construct(
|
||||
public string $type,
|
||||
public array $attributes,
|
||||
) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Gricob\IMAP\Protocol\Response\Line\Data\Fetch\BodyStructure;
|
||||
|
||||
use Gricob\IMAP\Protocol\Response\Line\Data\Fetch\BodyStructure;
|
||||
use Gricob\IMAP\Protocol\Response\Line\Data\Fetch\Envelope;
|
||||
|
||||
readonly class MessagePart extends SinglePart
|
||||
{
|
||||
/**
|
||||
* @param array<string, string> $attributes
|
||||
* @param string[]|null $language
|
||||
*/
|
||||
public function __construct(
|
||||
array $attributes,
|
||||
?string $id,
|
||||
?string $description,
|
||||
string $encoding,
|
||||
int $size,
|
||||
public Envelope $envelope,
|
||||
public BodyStructure $bodyStructure,
|
||||
public int $textLines,
|
||||
?string $md5,
|
||||
?Disposition $disposition,
|
||||
?array $language,
|
||||
?string $location,
|
||||
) {
|
||||
parent::__construct(
|
||||
'MESSAGE',
|
||||
'RFC822',
|
||||
$attributes,
|
||||
$id,
|
||||
$description,
|
||||
$encoding,
|
||||
$size,
|
||||
$md5,
|
||||
$disposition,
|
||||
$language,
|
||||
$location,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Gricob\IMAP\Protocol\Response\Line\Data\Fetch\BodyStructure;
|
||||
|
||||
final readonly class MultiPart extends Part
|
||||
{
|
||||
/**
|
||||
* @param array<string,string> $attributes
|
||||
* @param string[] $language
|
||||
* @param list<Part> $parts
|
||||
*/
|
||||
public function __construct(
|
||||
string $subtype,
|
||||
array $attributes,
|
||||
public array $parts,
|
||||
public ?Disposition $disposition,
|
||||
public ?array $language,
|
||||
public ?string $location,
|
||||
) {
|
||||
parent::__construct('MULTIPART', $subtype, $attributes);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Gricob\IMAP\Protocol\Response\Line\Data\Fetch\BodyStructure;
|
||||
|
||||
abstract readonly class Part
|
||||
{
|
||||
/**
|
||||
* @param array<string,string> $attributes
|
||||
*/
|
||||
public function __construct(
|
||||
public string $type,
|
||||
public string $subtype,
|
||||
public array $attributes,
|
||||
) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Gricob\IMAP\Protocol\Response\Line\Data\Fetch\BodyStructure;
|
||||
|
||||
readonly class SinglePart extends Part
|
||||
{
|
||||
/**
|
||||
* @param array<string,string> $attributes
|
||||
* @param string[]|null $language
|
||||
*/
|
||||
public function __construct(
|
||||
string $type,
|
||||
string $subtype,
|
||||
array $attributes,
|
||||
public ?string $id,
|
||||
public ?string $description,
|
||||
public string $encoding,
|
||||
public int $size,
|
||||
public ?string $md5,
|
||||
public ?Disposition $disposition,
|
||||
public ?array $language,
|
||||
public ?string $location,
|
||||
) {
|
||||
parent::__construct($type, $subtype, $attributes);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Gricob\IMAP\Protocol\Response\Line\Data\Fetch\BodyStructure;
|
||||
|
||||
final readonly class TextPart extends SinglePart
|
||||
{
|
||||
/**
|
||||
* @param array<string, string> $attributes
|
||||
* @param string[]|null $language
|
||||
*/
|
||||
public function __construct(
|
||||
string $subtype,
|
||||
array $attributes,
|
||||
?string $id,
|
||||
?string $description,
|
||||
string $encoding,
|
||||
int $size,
|
||||
public int $textLines,
|
||||
?string $md5,
|
||||
?Disposition $disposition,
|
||||
?array $language,
|
||||
?string $location,
|
||||
) {
|
||||
parent::__construct(
|
||||
'TEXT',
|
||||
$subtype,
|
||||
$attributes,
|
||||
$id,
|
||||
$description,
|
||||
$encoding,
|
||||
$size,
|
||||
$md5,
|
||||
$disposition,
|
||||
$language,
|
||||
$location,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user