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:
13
lib/Client/Protocol/Command/Argument/Search/All.php
Normal file
13
lib/Client/Protocol/Command/Argument/Search/All.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Gricob\IMAP\Protocol\Command\Argument\Search;
|
||||
|
||||
class All implements Criteria
|
||||
{
|
||||
public function __toString(): string
|
||||
{
|
||||
return 'ALL';
|
||||
}
|
||||
}
|
||||
15
lib/Client/Protocol/Command/Argument/Search/Before.php
Normal file
15
lib/Client/Protocol/Command/Argument/Search/Before.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Gricob\IMAP\Protocol\Command\Argument\Search;
|
||||
|
||||
use Gricob\IMAP\Protocol\Command\Argument\Date;
|
||||
|
||||
readonly class Before extends Date implements Criteria
|
||||
{
|
||||
public function __toString(): string
|
||||
{
|
||||
return 'BEFORE '.parent::__toString();
|
||||
}
|
||||
}
|
||||
11
lib/Client/Protocol/Command/Argument/Search/Criteria.php
Normal file
11
lib/Client/Protocol/Command/Argument/Search/Criteria.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Gricob\IMAP\Protocol\Command\Argument\Search;
|
||||
|
||||
use Gricob\IMAP\Protocol\Command\Argument\Argument;
|
||||
|
||||
interface Criteria extends Argument
|
||||
{
|
||||
}
|
||||
19
lib/Client/Protocol/Command/Argument/Search/Header.php
Normal file
19
lib/Client/Protocol/Command/Argument/Search/Header.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Gricob\IMAP\Protocol\Command\Argument\Search;
|
||||
|
||||
use Gricob\IMAP\Protocol\Command\Argument\QuotedString;
|
||||
|
||||
class Header implements Criteria
|
||||
{
|
||||
public function __construct(
|
||||
private string $fieldName,
|
||||
private string $value,
|
||||
) {
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return sprintf('HEADER %s %s', $this->fieldName, new QuotedString($this->value));
|
||||
}
|
||||
}
|
||||
17
lib/Client/Protocol/Command/Argument/Search/Not.php
Normal file
17
lib/Client/Protocol/Command/Argument/Search/Not.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Gricob\IMAP\Protocol\Command\Argument\Search;
|
||||
|
||||
final readonly class Not implements Criteria
|
||||
{
|
||||
public function __construct(private Criteria $criteria)
|
||||
{
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return 'NOT ('.$this->criteria.')';
|
||||
}
|
||||
}
|
||||
15
lib/Client/Protocol/Command/Argument/Search/Since.php
Normal file
15
lib/Client/Protocol/Command/Argument/Search/Since.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Gricob\IMAP\Protocol\Command\Argument\Search;
|
||||
|
||||
use Gricob\IMAP\Protocol\Command\Argument\Date;
|
||||
|
||||
readonly class Since extends Date implements Criteria
|
||||
{
|
||||
public function __toString(): string
|
||||
{
|
||||
return 'SINCE '.parent::__toString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user