Skip to content

Commit ce19d61

Browse files
authored
Merge pull request #661 from barbushin/Fix-php-cs-fixer-issues
Fix php-cs-fixer formatting issue
2 parents e630d64 + 389cbc9 commit ce19d61

File tree

5 files changed

+10
-14
lines changed

5 files changed

+10
-14
lines changed

src/PhpImap/Exceptions/ConnectionException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
*/
1414
class ConnectionException extends Exception
1515
{
16-
public function __construct($message, $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
}
2020

21-
public function getErrors($select = 'first')
21+
public function getErrors(string $select = 'first')
2222
{
2323
$message = $this->getMessage();
2424

src/PhpImap/Mailbox.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -837,21 +837,20 @@ public function markMailsAsImportant(array $mailId): void
837837
/**
838838
* Check, if the specified flag for the mail is set or not.
839839
*
840-
* @param int $mailsId A single mail ID
841-
* @param string $flag Which you can get are \Seen, \Answered, \Flagged, \Deleted, and \Draft as defined by RFC2060
840+
* @param int $mailId A single mail ID
841+
* @param string $flag Which you can get are \Seen, \Answered, \Flagged, \Deleted, and \Draft as defined by RFC2060
842842
*
843843
* @return bool True, when the flag is set, false when not
844844
*
845-
* @psalm-param list<int> $mailId
845+
* @psalm-param int $mailId
846846
*/
847847
public function flagIsSet(int $mailId, string $flag): bool
848848
{
849849
$flag = str_replace('\\', '', strtolower($flag));
850850

851851
$overview = Imap::fetch_overview($this->getImapStream(), $mailId, ST_UID);
852852

853-
if ($overview[0]->$flag == 1)
854-
{
853+
if ($overview[0]->$flag == 1) {
855854
return true;
856855
}
857856

@@ -1677,7 +1676,7 @@ protected function initImapStreamWithRetry()
16771676
return $this->initImapStream();
16781677
} catch (ConnectionException $exception) {
16791678
}
1680-
} while (--$retry > 0 && (!$this->connectionRetryDelay || !\usleep($this->connectionRetryDelay * 1000)));
1679+
} while (--$retry > 0 && (!$this->connectionRetryDelay || !\usleep((int) $this->connectionRetryDelay * 1000)));
16811680

16821681
throw $exception;
16831682
}
@@ -1899,8 +1898,11 @@ protected function getCombinedPath(string $folder, bool $absolute = false): stri
18991898
protected function possiblyGetEmailAndNameFromRecipient(object $recipient): ?array
19001899
{
19011900
if (isset($recipient->mailbox, $recipient->host)) {
1901+
/** @var string */
19021902
$recipientMailbox = $recipient->mailbox;
1903+
/** @var string */
19031904
$recipientHost = $recipient->host;
1905+
/** @var string|null */
19041906
$recipientPersonal = $recipient->personal ?? null;
19051907

19061908
if (!\is_string($recipientMailbox)) {

tests/unit/AbstractLiveMailboxTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ abstract class AbstractLiveMailboxTest extends TestCase
4545

4646
/**
4747
* @psalm-return Generator<empty, empty, mixed, void>
48-
*
49-
* @return Generator
5048
*/
5149
public function ComposeProvider(): Generator
5250
{

tests/unit/LiveMailboxIssue250Test.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ class LiveMailboxIssue250Test extends AbstractLiveMailboxTest
3838
{
3939
/**
4040
* @psalm-return Generator<int, array{0: array{subject: string}, 1: array{0: array{type: 0, 'contents.data': 'test'}}, 2: string}, mixed, void>
41-
*
42-
* @return Generator
4341
*/
4442
public function ComposeProvider(): Generator
4543
{

tests/unit/LiveMailboxTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ public function testGetImapStream(HiddenString $imapPath, HiddenString $login, H
144144

145145
/**
146146
* @psalm-return Generator<int, array{0: array{subject: string}, 1: array{0: array{type: 0|1|3, 'contents.data'?: string, encoding?: 3, subtype?: 'octet-stream', description?: '.gitignore'|'gitignore.', 'disposition.type'?: 'attachment', disposition?: array{filename: '.gitignore'|'gitignore.'}, 'type.parameters'?: array{name: '.gitignore'|'gitignore.'}}, 1?: array{type: 0, 'contents.data': 'test'}, 2?: array{type: 3, encoding: 3, subtype: 'octet-stream', description: 'foo.bin', 'disposition.type': 'attachment', disposition: array{filename: 'foo.bin'}, 'type.parameters': array{name: 'foo.bin'}, 'contents.data': string}, 3?: array{type: 3, encoding: 3, subtype: 'octet-stream', description: 'foo.bin', 'disposition.type': 'attachment', disposition: array{filename: 'foo.bin'}, 'type.parameters': array{name: 'foo.bin'}, 'contents.data': string}}, 2: string}, mixed, void>
147-
*
148-
* @return Generator
149147
*/
150148
public function ComposeProvider(): Generator
151149
{

0 commit comments

Comments
 (0)