Skip to content

Commit

Permalink
post-merge bug-fixing, updating psalm baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
bapcltd-marv committed Jan 16, 2020
1 parent ca718e5 commit 0ee1bbf
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .php_cs.dist
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return PhpCsFixer\Config::create()
->setRules([
'@Symfony' => true,
Expand Down
13 changes: 1 addition & 12 deletions psalm.baseline.xml
Expand Up @@ -107,7 +107,7 @@
<code>$t[0]</code>
<code>$t[1]</code>
</PossiblyUndefinedArrayOffset>
<PossiblyUnusedMethod occurrences="35">
<PossiblyUnusedMethod occurrences="34">
<code>setOAuthToken</code>
<code>getOAuthToken</code>
<code>setConnectionRetry</code>
Expand Down Expand Up @@ -137,7 +137,6 @@
<code>getQuotaLimit</code>
<code>getQuotaUsage</code>
<code>getRawMail</code>
<code>getImapPath</code>
<code>getMailMboxFormat</code>
<code>getMailboxes</code>
<code>getSubscribedMailboxes</code>
Expand All @@ -152,16 +151,6 @@
</UnusedVariable>
</file>
<file src="tests/unit/MailboxTest.php">
<DeprecatedMethod occurrences="8">
<code>assertAttributeEquals</code>
<code>assertAttributeEquals</code>
<code>assertAttributeEquals</code>
<code>assertAttributeEquals</code>
<code>assertAttributeEquals</code>
<code>assertAttributeEquals</code>
<code>assertAttributeEquals</code>
<code>assertAttributeEquals</code>
</DeprecatedMethod>
<UndefinedConstant occurrences="5">
<code>OPENTIMEOUT</code>
<code>READTIMEOUT</code>
Expand Down
9 changes: 6 additions & 3 deletions tests/unit/Fixtures/DataPartInfo.php
@@ -1,18 +1,21 @@
<?php
/**
* @author BAPCLTD-Marv
*/
declare(strict_types=1);

namespace PhpImap\Fixtures;

use PhpImap\DataPartInfo as Base;

class DataPartInfo extends Base
{
public function fetch()
public function fetch(): string
{
return $this->decodeAfterFetch();
}

/** @param string|null $data */
public function setData($data)
public function setData(?string $data): void
{
$this->data = $data;
}
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/Fixtures/Mailbox.php
@@ -1,12 +1,16 @@
<?php
/**
* @author BAPCLTD-Marv
*/
declare(strict_types=1);

namespace PhpImap\Fixtures;

use PhpImap\Mailbox as Base;

class Mailbox extends Base
{
public function getImapPassword()
public function getImapPassword(): string
{
return $this->imapPassword;
}
Expand Down
11 changes: 6 additions & 5 deletions tests/unit/IncomingMailTest.php
Expand Up @@ -2,20 +2,21 @@
/**
* @author BAPCLTD-Marv
*/
declare(strict_types=1);

namespace PhpImap;

use PHPUnit\Framework\TestCase;

class IncomingMailTest extends TestCase
{
public function testSetHeader()
public function testSetHeader(): void
{
$mail = new IncomingMail();
$header = new IncomingMailHeader();

$mail->id = 1;
$header->id = 2;
$mail->id = '1';
$header->id = '2';

$mail->isDraft = true;
$header->isDraft = false;
Expand All @@ -38,7 +39,7 @@ public function testSetHeader()
}
}

public function testDataPartInfo()
public function testDataPartInfo(): void
{
$mail = new IncomingMail();
$mailbox = new Mailbox('', '', '');
Expand All @@ -55,7 +56,7 @@ public function testDataPartInfo()
$this->assertTrue($mail->__isset('textPlain'));
}

public function testAttachments()
public function testAttachments(): void
{
$mail = new IncomingMail();

Expand Down
6 changes: 2 additions & 4 deletions tests/unit/MailboxTest.php
@@ -1,12 +1,10 @@
<?php

declare(strict_types=1);

/**
* Mailbox - PHPUnit tests.
*
* @author Sebastian Kraetzig <sebastian-kraetzig@gmx.de>
*/
declare(strict_types=1);

namespace PhpImap;

Expand Down Expand Up @@ -197,7 +195,7 @@ public function testSetAndGetImapSearchOption(): void
$this->assertEquals($mailbox->getImapSearchOption(), 2);

$this->expectException(InvalidParameterException::class);
$this->mailbox->setImapSearchOption(self::ANYTHING);
$mailbox->setImapSearchOption(self::ANYTHING);

$mailbox->setImapSearchOption(SE_UID);
$this->assertEquals($mailbox->getImapSearchOption(), 1);
Expand Down

0 comments on commit 0ee1bbf

Please sign in to comment.