Skip to content

Commit 9c57462

Browse files
authored
php 8.4
1 parent 94107fd commit 9c57462

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/PhpImap/Exceptions/ConnectionException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class ConnectionException extends Exception
1515
{
16-
public function __construct(array $message, int $code = 0, Exception $previous = null)
16+
public function __construct(array $message, int $code = 0, ?Exception $previous = null)
1717
{
1818
parent::__construct(json_encode($message), $code, $previous);
1919
}

src/PhpImap/Imap.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public static function append(
7979
$imap_stream,
8080
string $mailbox,
8181
string $message,
82-
string $options = null,
83-
string $internal_date = null
82+
?string $options = null,
83+
?string $internal_date = null
8484
): bool {
8585
\imap_errors(); // flush errors
8686

@@ -816,7 +816,7 @@ public static function search(
816816
$imap_stream,
817817
string $criteria,
818818
int $options = SE_FREE,
819-
string $charset = null,
819+
?string $charset = null,
820820
bool $encodeCriteriaAsUtf7Imap = false
821821
): array {
822822
\imap_errors(); // flush errors
@@ -906,8 +906,8 @@ public static function sort(
906906
int $criteria,
907907
bool $reverse,
908908
int $options,
909-
string $search_criteria = null,
910-
string $charset = null
909+
?string $search_criteria = null,
910+
?string $charset = null
911911
): array {
912912
\imap_errors(); // flush errors
913913

src/PhpImap/Mailbox.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class Mailbox
165165
/**
166166
* @throws InvalidParameterException
167167
*/
168-
public function __construct(string $imapPath, string $login, string $password, string $attachmentsDir = null, string $serverEncoding = 'UTF-8', bool $trimImapPath = true, bool $attachmentFilenameMode = false)
168+
public function __construct(string $imapPath, string $login, string $password, ?string $attachmentsDir = null, string $serverEncoding = 'UTF-8', bool $trimImapPath = true, bool $attachmentFilenameMode = false)
169169
{
170170
$this->imapPath = (true == $trimImapPath) ? \trim($imapPath) : $imapPath;
171171
$this->imapLogin = \trim($login);
@@ -380,7 +380,7 @@ public function getLogin(): string
380380
*
381381
* @throws InvalidParameterException
382382
*/
383-
public function setConnectionArgs(int $options = 0, int $retriesNum = 0, array $params = null): void
383+
public function setConnectionArgs(int $options = 0, int $retriesNum = 0, array ?$params = null): void
384384
{
385385
if (0 !== $options) {
386386
if (($options & self::IMAP_OPTIONS_SUPPORTED_VALUES) !== $options) {
@@ -1020,7 +1020,7 @@ public function sortMails(
10201020
int $criteria = SORTARRIVAL,
10211021
bool $reverse = true,
10221022
?string $searchCriteria = 'ALL',
1023-
string $charset = null
1023+
?string $charset = null
10241024
): array {
10251025
return Imap::sort(
10261026
$this->getImapStream(),
@@ -1634,8 +1634,8 @@ public function unsubscribeMailbox(string $mailbox): void
16341634
public function appendMessageToMailbox(
16351635
$message,
16361636
string $mailbox = '',
1637-
string $options = null,
1638-
string $internal_date = null
1637+
?string $options = null,
1638+
?string $internal_date = null
16391639
): bool {
16401640
if (
16411641
\is_array($message) &&

tests/unit/Fixtures/DataPartInfo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function fetch(): string
1616
return $this->decodeAfterFetch($this->data);
1717
}
1818

19-
public function setData(string $data = null): void
19+
public function setData(?string $data = null): void
2020
{
2121
$this->data = $data;
2222
}

tests/unit/MailboxTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ public function connectionArgsProvider(): Generator
678678
*
679679
* @psalm-param array{DISABLE_AUTHENTICATOR?:string}|array<empty, empty> $param
680680
*/
681-
public function testSetConnectionArgs(string $assertMethod, int $option, int $retriesNum, array $param = null): void
681+
public function testSetConnectionArgs(string $assertMethod, int $option, int $retriesNum, ?array $param = null): void
682682
{
683683
$mailbox = $this->getMailbox();
684684

0 commit comments

Comments
 (0)