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:
24
lib/Client/Protocol/Command/Argument/Date.php
Normal file
24
lib/Client/Protocol/Command/Argument/Date.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Gricob\IMAP\Protocol\Command\Argument;
|
||||
|
||||
use DateTimeInterface;
|
||||
|
||||
readonly class Date implements Argument
|
||||
{
|
||||
public function __construct(private DateTimeInterface $value)
|
||||
{
|
||||
}
|
||||
|
||||
public static function tryFrom(?DateTimeInterface $value): ?self
|
||||
{
|
||||
return is_null($value) ? null : new self($value);
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->value->format('d-M-Y');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user