Skip to content

Commit 3538b5f

Browse files
committed
added property typehints
1 parent b88fc6f commit 3538b5f

File tree

7 files changed

+31
-55
lines changed

7 files changed

+31
-55
lines changed

src/Mail/DkimSigner.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,15 @@ class DkimSigner implements Signer
2828

2929
private const DKIM_SIGNATURE = 'DKIM-Signature';
3030

31-
/** @var string */
32-
private $domain;
31+
private string $domain;
3332

34-
/** @var array */
35-
private $signHeaders;
33+
private array $signHeaders;
3634

37-
/** @var string */
38-
private $selector;
35+
private string $selector;
3936

40-
/** @var string */
41-
private $privateKey;
37+
private string $privateKey;
4238

43-
/** @var string */
44-
private $passPhrase;
39+
private string $passPhrase;
4540

4641

4742
/** @throws Nette\NotSupportedException */

src/Mail/FallbackMailer.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,19 @@ class FallbackMailer implements Mailer
1717
use Nette\SmartObject;
1818

1919
/** @var callable[] function (FallbackMailer $sender, SendException $e, Mailer $mailer, Message $mail): void */
20-
public $onFailure = [];
20+
public iterable $onFailure = [];
2121

2222
/** @var Mailer[] */
23-
private $mailers;
23+
private array $mailers;
2424

25-
/** @var int */
26-
private $retryCount;
25+
private int $retryCount;
2726

28-
/** @var int in miliseconds */
29-
private $retryWaitTime;
27+
/** in miliseconds */
28+
private int $retryWaitTime;
3029

3130

3231
/**
3332
* @param Mailer[] $mailers
34-
* @param int $retryWaitTime in miliseconds
3533
*/
3634
public function __construct(array $mailers, int $retryCount = 3, int $retryWaitTime = 1000)
3735
{

src/Mail/Message.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,16 @@ class Message extends MimePart
2727
NORMAL = 3,
2828
LOW = 5;
2929

30-
/** @var array */
31-
public static $defaultHeaders = [
30+
public static array $defaultHeaders = [
3231
'MIME-Version' => '1.0',
3332
'X-Mailer' => 'Nette Framework',
3433
];
3534

36-
/** @var array */
37-
private $attachments = [];
35+
private array $attachments = [];
3836

39-
/** @var array */
40-
private $inlines = [];
37+
private array $inlines = [];
4138

42-
/** @var string */
43-
private $htmlBody = '';
39+
private string $htmlBody = '';
4440

4541

4642
public function __construct()

src/Mail/MimePart.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,11 @@ class MimePart
3838
SEQUENCE_VALUE = 1, // value, RFC 2231
3939
SEQUENCE_WORD = 2; // encoded-word, RFC 2047
4040

41-
/** @var array */
42-
private $headers = [];
41+
private array $headers = [];
4342

44-
/** @var array */
45-
private $parts = [];
43+
private array $parts = [];
4644

47-
/** @var string */
48-
private $body = '';
45+
private string $body = '';
4946

5047

5148
/**

src/Mail/SendmailMailer.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ class SendmailMailer implements Mailer
1919
{
2020
use Nette\SmartObject;
2121

22-
/** @var string|null */
23-
public $commandArgs;
22+
public ?string $commandArgs = null;
2423

25-
/** @var Signer|null */
26-
private $signer;
24+
private ?Signer $signer = null;
2725

2826

2927
/** @return static */

src/Mail/SmtpMailer.php

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,38 +19,30 @@ class SmtpMailer implements Mailer
1919
{
2020
use Nette\SmartObject;
2121

22-
/** @var Signer|null */
23-
private $signer;
22+
private ?Signer $signer = null;
2423

25-
/** @var resource|null */
24+
/** @var ?resource */
2625
private $connection;
2726

28-
/** @var string */
29-
private $host;
27+
private string $host;
3028

31-
/** @var int */
32-
private $port;
29+
private ?int $port;
3330

34-
/** @var string */
35-
private $username;
31+
private string $username;
3632

37-
/** @var string */
38-
private $password;
33+
private string $password;
3934

40-
/** @var string ssl | tls | (empty) */
41-
private $secure;
35+
/** ssl | tls | (empty) */
36+
private string $secure;
4237

43-
/** @var int */
44-
private $timeout;
38+
private int $timeout;
4539

4640
/** @var resource */
4741
private $context;
4842

49-
/** @var bool */
50-
private $persistent;
43+
private bool $persistent;
5144

52-
/** @var string */
53-
private $clientHost;
45+
private string $clientHost;
5446

5547

5648
public function __construct(array $options = [])

src/Mail/exceptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class SmtpException extends SendException
3131
class FallbackMailerException extends SendException
3232
{
3333
/** @var SendException[] */
34-
public $failures;
34+
public array $failures;
3535
}
3636

3737

0 commit comments

Comments
 (0)