Skip to content

Commit

Permalink
implementing typed properties
Browse files Browse the repository at this point in the history
  • Loading branch information
bapcltd-marv committed Feb 11, 2020
1 parent a331870 commit 987a73b
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 60 deletions.
10 changes: 5 additions & 5 deletions src/PhpImap/DataPartInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class DataPartInfo
*
* @readonly
*/
public $id;
public int $id;

/**
* @var int|mixed
Expand All @@ -30,7 +30,7 @@ class DataPartInfo
public $encoding;

/** @var string|null */
public $charset;
public ?string $charset = null;

/**
* @var 0|string
Expand All @@ -44,17 +44,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 0|string $part
Expand Down
10 changes: 5 additions & 5 deletions src/PhpImap/IncomingMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<DataPartInfo>, 1:list<DataPartInfo>}
*/
protected $dataInfo = [[], []];
protected array $dataInfo = [[], []];

/** @var string|null */
private $textPlain;
private ?string $textPlain = null;

/** @var string|null */
private $textHtml;
private ?string $textHtml = null;

/**
* __get() is utilized for reading data from inaccessible (protected
Expand Down
20 changes: 10 additions & 10 deletions src/PhpImap/IncomingMailAttachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
* @return string|false|null
Expand Down
48 changes: 24 additions & 24 deletions src/PhpImap/IncomingMailHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,90 +12,90 @@
class IncomingMailHeader
{
/** @var int|null $id The IMAP message ID - not the "Message-ID:"-header of the email */
public $id;
public ?int $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<string, string|null>
*/
public $to = [];
public array $to = [];

/** @var string|null */
public $toString;
public ?string $toString = null;

/**
* @var (string|null)[]
*
* @psalm-var array<string, string|null>
*/
public $cc = [];
public array $cc = [];

/**
* @var (string|null)[]
*
* @psalm-var array<string, string|null>
*/
public $bcc = [];
public array $bcc = [];

/**
* @var (string|null)[]
*
* @psalm-var array<string, string|null>
*/
public $replyTo = [];
public array $replyTo = [];

/** @var string|null */
public $messageId;
public ?string $messageId = null;
}
32 changes: 16 additions & 16 deletions src/PhpImap/Mailbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,56 +57,56 @@ class Mailbox
const PART_TYPE_TWO = 2;

/** @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;

/** @psalm-var array{DISABLE_AUTHENTICATOR?:string} */
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;
Expand Down

0 comments on commit 987a73b

Please sign in to comment.