Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PHPStan new errors #519

Merged
merged 1 commit into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ csfix: vendor

.PHONY: static-analysis
static-analysis: vendor
vendor/bin/phpstan analyse
$(or ${PHP_BIN},php) vendor/bin/phpstan analyse

wait-for-it:
wget -O wait-for-it "https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh"
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
"ext-mbstring": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0.0",
"laminas/laminas-mail": "^2.14.0",
"friendsofphp/php-cs-fixer": "^v3.1.0",
"laminas/laminas-mail": "^2.15.0",
"malukenho/mcbumpface": "^1.1.5",
"phpstan/phpstan": "^0.12.85",
"phpstan/phpstan-phpunit": "^0.12.18",
"phpstan/phpstan-strict-rules": "^0.12.9",
"phpunit/phpunit": "^9.5.4"
"phpstan/phpstan": "^0.12.99",
"phpstan/phpstan-phpunit": "^0.12.22",
"phpstan/phpstan-strict-rules": "^0.12.11",
"phpunit/phpunit": "^9.5.9"
},
"autoload": {
"psr-4": {
Expand Down
15 changes: 15 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,21 @@ parameters:
count: 1
path: tests/ConnectionTest.php

-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) with 'date' and \\*NEVER\\* will always evaluate to true\\.$#"
count: 1
path: tests/MessageTest.php

-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) with 'from' and Ddeboer\\\\Imap\\\\Message\\\\Headers will always evaluate to false\\.$#"
count: 1
path: tests/MessageTest.php

-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) with 'recent' and \\*NEVER\\* will always evaluate to true\\.$#"
count: 1
path: tests/MessageTest.php

-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'Ddeboer\\\\\\\\Imap\\\\\\\\Message\\\\\\\\EmailAddress' and Ddeboer\\\\Imap\\\\Message\\\\EmailAddress will always evaluate to true\\.$#"
count: 2
Expand Down
5 changes: 5 additions & 0 deletions tests/EmbeddedMessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public function testEmbeddedMessageWithoutContentDisposition(): void
static::assertSame('file.jpg', $attachment->getFilename());

$attachment = \next($attachments);
static::assertNotFalse($attachment);
static::assertTrue($attachment->isEmbeddedMessage());

$embeddedMessage = $attachment->getEmbeddedMessage();
Expand All @@ -142,18 +143,22 @@ public function testEmbeddedMessageWithoutContentDisposition(): void
static::assertNotEmpty($embeddedMessage->getBodyHtml());

$attachment = \next($attachments);
static::assertNotFalse($attachment);
static::assertNotEmpty($attachment->getContent());
static::assertSame('file1.xlsx', $attachment->getFilename());

$attachment = \next($attachments);
static::assertNotFalse($attachment);
static::assertNotEmpty($attachment->getContent());
static::assertSame('file2.xlsx', $attachment->getFilename());

$attachment = \next($attachments);
static::assertNotFalse($attachment);
static::assertNotEmpty($attachment->getContent());
static::assertSame('file3.xlsx', $attachment->getFilename());

$attachment = \next($attachments);
static::assertNotFalse($attachment);
static::assertNotEmpty($attachment->getContent());
static::assertSame('file4.zip', $attachment->getFilename());
}
Expand Down