Files
Sebastian 869f2e4fb4
JS Unit Tests / test (pull_request) Successful in 23s
Build Test / build (pull_request) Successful in 26s
PHP Unit Tests / test (pull_request) Successful in 52s
refactor: message object properties
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
2026-06-16 13:12:30 -04:00

71 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace KTXF\Mail\Object;
use KTXF\Json\JsonSerializable;
/**
* Address Interface
*
* Represents an email address with optional display name.
*
* @since 2025.05.01
*/
interface AddressInterface extends JsonSerializable {
public const PROPERTY_ADDRESS = 'address';
public const PROPERTY_LABEL = 'label';
/*
* Converts the Address to an array representation
*
* @return array<address: string, label: string|null>
*/
public function toArray(): array;
/**
* Gets the email address
*
* @since 2025.05.01
*/
public function getAddress(): string;
/**
* Sets the email address
*
* @since 2025.05.01
*/
public function setAddress(string $value): static;
/**
* Gets the display name
*
* @since 2025.05.01
*/
public function getLabel(): ?string;
/**
* Sets the display name
*
* @since 2025.05.01
*/
public function setLabel(?string $value): static;
/**
* Gets the formatted address string
*
* @since 2025.05.01
*
* @return string Formatted as "Name <address>" or just "address" if no name
*/
public function toString(): string;
}