diff --git a/src/PhpImap/DataPartInfo.php b/src/PhpImap/DataPartInfo.php index 38ece3e9..24d6541b 100644 --- a/src/PhpImap/DataPartInfo.php +++ b/src/PhpImap/DataPartInfo.php @@ -29,7 +29,7 @@ class DataPartInfo public $encoding; /** @var string|null */ - public $charset; + public ?string $charset = null; /** * @var string|int @@ -43,17 +43,17 @@ class DataPartInfo * * @readonly */ - public $mail; + public Mailbox $mail; /** * @var int * * @readonly */ - public $options; + public int $options; /** @var string|null */ - protected $data; + protected ?string $data = null; /** * @param string|int $id diff --git a/src/PhpImap/IncomingMail.php b/src/PhpImap/IncomingMail.php index 8d532e5c..3ab3e5d1 100644 --- a/src/PhpImap/IncomingMail.php +++ b/src/PhpImap/IncomingMail.php @@ -21,23 +21,23 @@ class IncomingMail extends IncomingMailHeader /** * @var IncomingMailAttachment[] */ - protected $attachments = []; + protected array $attachments = []; /** @var bool */ - protected $hasAttachments = false; + protected bool $hasAttachments = false; /** * @var DataPartInfo[][] * * @psalm-var array{0:list, 1:list} */ - protected $dataInfo = [[], []]; + protected array $dataInfo = [[], []]; /** @var string|null */ - private $textPlain; + private ?string $textPlain = null; /** @var string|null */ - private $textHtml; + private ?string $textHtml = null; public function setHeader(IncomingMailHeader $header): void { diff --git a/src/PhpImap/IncomingMailAttachment.php b/src/PhpImap/IncomingMailAttachment.php index e39bf9db..1c913922 100644 --- a/src/PhpImap/IncomingMailAttachment.php +++ b/src/PhpImap/IncomingMailAttachment.php @@ -17,36 +17,36 @@ class IncomingMailAttachment { /** @var string|null */ - public $id; + public ?string $id = null; /** @var string|null */ - public $contentId; + public ?string $contentId = null; /** @var string|null */ - public $name; + public ?string $name = null; /** @var string|null */ - public $disposition; + public ?string $disposition = null; /** @var string|null */ - public $charset; + public ?string $charset = null; /** @var bool|null */ - public $emlOrigin; + public ?bool $emlOrigin = null; /** @var string|null */ - private $file_path; + private ?string $file_path = null; /** @var DataPartInfo|null */ - private $dataInfo; + private ?DataPartInfo $dataInfo = null; /** * @var string|null */ - private $mimeType; + private ?string $mimeType = null; /** @var string|null */ - private $filePath; + private ?string $filePath = null; public function __get(string $name) { diff --git a/src/PhpImap/IncomingMailHeader.php b/src/PhpImap/IncomingMailHeader.php index 0879f1fa..feb11413 100644 --- a/src/PhpImap/IncomingMailHeader.php +++ b/src/PhpImap/IncomingMailHeader.php @@ -12,90 +12,90 @@ class IncomingMailHeader { /** @var string|null $id The IMAP message ID - not the "Message-ID:"-header of the email */ - public $id; + public ?string $id = null; /** @var bool */ - public $isDraft = false; + public bool $isDraft = false; /** @var string|null */ - public $date; + public ?string $date = null; /** @var string|null */ - public $headersRaw; + public ?string $headersRaw = null; /** @var object|null */ - public $headers; + public ?object $headers = null; /** @var string|null */ - public $priority; + public ?string $priority = null; /** @var string|null */ - public $importance; + public ?string $importance = null; /** @var string|null */ - public $sensitivity; + public ?string $sensitivity = null; /** @var string|null */ - public $autoSubmitted; + public ?string $autoSubmitted = null; /** @var string|null */ - public $precedence; + public ?string $precedence = null; /** @var string|null */ - public $failedRecipients; + public ?string $failedRecipients = null; /** @var string|null */ - public $subject; + public ?string $subject = null; /** @var string|null */ - public $fromHost; + public ?string $fromHost = null; /** @var string|null */ - public $fromName; + public ?string $fromName = null; /** @var string|null */ - public $fromAddress; + public ?string $fromAddress = null; /** @var string|null */ - public $senderHost; + public ?string $senderHost = null; /** @var string|null */ - public $senderName; + public ?string $senderName = null; /** @var string|null */ - public $senderAddress; + public ?string $senderAddress = null; /** * @var (string|null)[] * * @psalm-var array */ - public $to = []; + public array $to = []; /** @var string|null */ - public $toString; + public ?string $toString = null; /** * @var (string|null)[] * * @psalm-var array */ - public $cc = []; + public array $cc = []; /** * @var (string|null)[] * * @psalm-var array */ - public $bcc = []; + public array $bcc = []; /** * @var (string|null)[] * * @psalm-var array */ - public $replyTo = []; + public array $replyTo = []; /** @var string|null */ - public $messageId; + public ?string $messageId = null; } diff --git a/src/PhpImap/Mailbox.php b/src/PhpImap/Mailbox.php index 8d3f20ae..a0de8e1f 100644 --- a/src/PhpImap/Mailbox.php +++ b/src/PhpImap/Mailbox.php @@ -34,56 +34,56 @@ class Mailbox { /** @var string */ - protected $imapPath; + protected string $imapPath; /** @var string */ - protected $imapLogin; + protected string $imapLogin; /** @var string */ - protected $imapPassword; + protected string $imapPassword; /** @var string|null */ - protected $imapOAuthAccessToken = null; + protected ?string $imapOAuthAccessToken = null; /** @var int */ - protected $imapSearchOption = SE_UID; + protected int $imapSearchOption = SE_UID; /** @var int */ - protected $connectionRetry = 0; + protected int $connectionRetry = 0; /** @var int */ - protected $connectionRetryDelay = 100; + protected int $connectionRetryDelay = 100; /** @var int */ - protected $imapOptions = 0; + protected int $imapOptions = 0; /** @var int */ - protected $imapRetriesNum = 0; + protected int $imapRetriesNum = 0; /** @var array */ - protected $imapParams = []; + protected array $imapParams = []; /** @var string */ - protected $serverEncoding = 'UTF-8'; + protected string $serverEncoding = 'UTF-8'; /** @var string|null */ - protected $attachmentsDir = null; + protected ?string $attachmentsDir = null; /** @var bool */ - protected $expungeOnDisconnect = true; + protected bool $expungeOnDisconnect = true; /** * @var int[] * * @psalm-var array{1?:int, 2?:int, 3?:int, 4?:int} */ - protected $timeouts = []; + protected array $timeouts = []; /** @var bool */ - protected $attachmentsIgnore = false; + protected bool $attachmentsIgnore = false; /** @var string */ - protected $pathDelimiter = '.'; + protected string $pathDelimiter = '.'; /** @var resource|null */ private $imapStream;