Skip to content

Commit 7b98a9a

Browse files
authored
Merge pull request #37 from rpkamp/upgrade-doctrine-cs
Upgrade doctrine CS to version 7
2 parents 65a89f4 + 8fa4e54 commit 7b98a9a

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@
3333
"phpmd/phpmd": "^2.1.2",
3434
"phpunit/phpunit": "^8.0",
3535
"php-http/curl-client": "^2.0",
36-
"squizlabs/php_codesniffer": "^3.4",
3736
"swiftmailer/swiftmailer": "^6.2",
3837
"phpstan/phpstan": "^0.12",
3938
"pdepend/pdepend": "^2.5",
4039
"maglnet/composer-require-checker": "^2.0",
4140
"nyholm/psr7": "^1.2",
42-
"doctrine/coding-standard": "^6.0"
41+
"doctrine/coding-standard": "^7.0"
4342
}
4443
}

phpcs.xml.dist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
<exclude name="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison.DisallowedYodaComparison" />
2121
<exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.IncorrectWhitespaceBetweenOpenTagAndDeclare" />
2222
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing.IncorrectWhitespaceBeforeColon" />
23+
24+
<!-- This package supports PHP 7.2/7.3 and therefore can not use native type hints -->
25+
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint" />
2326
</rule>
2427

2528
<!-- require declare(strict_types=1) in each file, with 0 empty lines above and 1 empty line below -->

src/Message/ContactCollection.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ public function contains(Contact $needle): bool
5757
return false;
5858
}
5959

60+
/**
61+
* @return Traversable<Contact>
62+
*/
6063
public function getIterator(): Traversable
6164
{
6265
return new ArrayIterator($this->contacts);

src/Message/Message.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public function __construct(
7474
);
7575
}
7676
}
77+
7778
$this->messageId = $messageId;
7879
$this->sender = $sender;
7980
$this->recipients = $recipients;

src/Message/Mime/MimePartCollection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public function getBody(): string
8282
if ($mimePart->isAttachment()) {
8383
continue;
8484
}
85+
8586
if (stripos($mimePart->getContentType(), 'text/html') === 0) {
8687
return $mimePart->getBody();
8788
}
@@ -91,6 +92,7 @@ public function getBody(): string
9192
if ($mimePart->isAttachment()) {
9293
continue;
9394
}
95+
9496
if (stripos($mimePart->getContentType(), 'text/plain') === 0) {
9597
return $mimePart->getBody();
9698
}

0 commit comments

Comments
 (0)