Skip to content

Commit 2ae9f62

Browse files
Merge branch '5.4' into 6.3
* 5.4: Fix implicitly-required parameters List CS fix in .git-blame-ignore-revs Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value [Messenger][AmazonSqs] Allow async-aws/sqs version 2
2 parents cacb478 + c1dbce1 commit 2ae9f62

12 files changed

+17
-17
lines changed

Crypto/SMimeEncrypter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class SMimeEncrypter extends SMime
2626
* @param string|string[] $certificate The path (or array of paths) of the file(s) containing the X.509 certificate(s)
2727
* @param int|null $cipher A set of algorithms used to encrypt the message. Must be one of these PHP constants: https://www.php.net/manual/en/openssl.ciphers.php
2828
*/
29-
public function __construct(string|array $certificate, int $cipher = null)
29+
public function __construct(string|array $certificate, ?int $cipher = null)
3030
{
3131
if (!\extension_loaded('openssl')) {
3232
throw new \LogicException('PHP extension "openssl" is required to use SMime.');

Crypto/SMimeSigner.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class SMimeSigner extends SMime
3131
* @param string|null $extraCerts The path of the file containing intermediate certificates (in PEM format) needed by the signing certificate
3232
* @param int|null $signOptions Bitwise operator options for openssl_pkcs7_sign() (@see https://secure.php.net/manual/en/openssl.pkcs7.flags.php)
3333
*/
34-
public function __construct(string $certificate, string $privateKey, string $privateKeyPassphrase = null, string $extraCerts = null, int $signOptions = null)
34+
public function __construct(string $certificate, string $privateKey, ?string $privateKeyPassphrase = null, ?string $extraCerts = null, ?int $signOptions = null)
3535
{
3636
if (!\extension_loaded('openssl')) {
3737
throw new \LogicException('PHP extension "openssl" is required to use SMime.');

DraftEmail.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
class DraftEmail extends Email
2121
{
22-
public function __construct(Headers $headers = null, AbstractPart $body = null)
22+
public function __construct(?Headers $headers = null, ?AbstractPart $body = null)
2323
{
2424
parent::__construct($headers, $body);
2525

Email.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -329,15 +329,15 @@ public function getHtmlCharset(): ?string
329329
*
330330
* @return $this
331331
*/
332-
public function attach($body, string $name = null, string $contentType = null): static
332+
public function attach($body, ?string $name = null, ?string $contentType = null): static
333333
{
334334
return $this->addPart(new DataPart($body, $name, $contentType));
335335
}
336336

337337
/**
338338
* @return $this
339339
*/
340-
public function attachFromPath(string $path, string $name = null, string $contentType = null): static
340+
public function attachFromPath(string $path, ?string $name = null, ?string $contentType = null): static
341341
{
342342
return $this->addPart(new DataPart(new File($path), $name, $contentType));
343343
}
@@ -347,15 +347,15 @@ public function attachFromPath(string $path, string $name = null, string $conten
347347
*
348348
* @return $this
349349
*/
350-
public function embed($body, string $name = null, string $contentType = null): static
350+
public function embed($body, ?string $name = null, ?string $contentType = null): static
351351
{
352352
return $this->addPart((new DataPart($body, $name, $contentType))->asInline());
353353
}
354354

355355
/**
356356
* @return $this
357357
*/
358-
public function embedFromPath(string $path, string $name = null, string $contentType = null): static
358+
public function embedFromPath(string $path, ?string $name = null, ?string $contentType = null): static
359359
{
360360
return $this->addPart((new DataPart(new File($path), $name, $contentType))->asInline());
361361
}

FileinfoMimeTypeGuesser.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class FileinfoMimeTypeGuesser implements MimeTypeGuesserInterface
2828
*
2929
* @see http://www.php.net/manual/en/function.finfo-open.php
3030
*/
31-
public function __construct(string $magicFile = null)
31+
public function __construct(?string $magicFile = null)
3232
{
3333
$this->magicFile = $magicFile;
3434
}

Header/AbstractHeader.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ protected function generateTokenLines(string $token): array
237237
/**
238238
* Generate a list of all tokens in the final header.
239239
*/
240-
protected function toTokens(string $string = null): array
240+
protected function toTokens(?string $string = null): array
241241
{
242242
$string ??= $this->getBodyAsString();
243243

Header/Headers.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public function get(string $name): ?HeaderInterface
188188
return array_shift($values);
189189
}
190190

191-
public function all(string $name = null): iterable
191+
public function all(?string $name = null): iterable
192192
{
193193
if (null === $name) {
194194
foreach ($this->headers as $name => $collection) {

Header/ParameterizedHeader.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function getBodyAsString(): string
8585
* This doesn't need to be overridden in theory, but it is for implementation
8686
* reasons to prevent potential breakage of attributes.
8787
*/
88-
protected function toTokens(string $string = null): array
88+
protected function toTokens(?string $string = null): array
8989
{
9090
$tokens = parent::toTokens(parent::getBodyAsString());
9191

Message.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Message extends RawMessage
2424
private Headers $headers;
2525
private ?AbstractPart $body;
2626

27-
public function __construct(Headers $headers = null, AbstractPart $body = null)
27+
public function __construct(?Headers $headers = null, ?AbstractPart $body = null)
2828
{
2929
$this->headers = $headers ? clone $headers : new Headers();
3030
$this->body = $body;
@@ -42,7 +42,7 @@ public function __clone()
4242
/**
4343
* @return $this
4444
*/
45-
public function setBody(AbstractPart $body = null): static
45+
public function setBody(?AbstractPart $body = null): static
4646
{
4747
if (1 > \func_num_args()) {
4848
trigger_deprecation('symfony/mime', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);

Part/DataPart.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class DataPart extends TextPart
2929
/**
3030
* @param resource|string|File $body Use a File instance to defer loading the file until rendering
3131
*/
32-
public function __construct($body, string $filename = null, string $contentType = null, string $encoding = null)
32+
public function __construct($body, ?string $filename = null, ?string $contentType = null, ?string $encoding = null)
3333
{
3434
unset($this->_parent);
3535

@@ -49,7 +49,7 @@ public function __construct($body, string $filename = null, string $contentType
4949
$this->setDisposition('attachment');
5050
}
5151

52-
public static function fromPath(string $path, string $name = null, string $contentType = null): self
52+
public static function fromPath(string $path, ?string $name = null, ?string $contentType = null): self
5353
{
5454
return new self(new File($path), $name, $contentType);
5555
}

Part/TextPart.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class TextPart extends AbstractPart
4242
/**
4343
* @param resource|string|File $body Use a File instance to defer loading the file until rendering
4444
*/
45-
public function __construct($body, ?string $charset = 'utf-8', string $subtype = 'plain', string $encoding = null)
45+
public function __construct($body, ?string $charset = 'utf-8', string $subtype = 'plain', ?string $encoding = null)
4646
{
4747
unset($this->_headers);
4848

Test/Constraint/EmailAttachmentCount.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class EmailAttachmentCount extends Constraint
2020
private int $expectedValue;
2121
private ?string $transport;
2222

23-
public function __construct(int $expectedValue, string $transport = null)
23+
public function __construct(int $expectedValue, ?string $transport = null)
2424
{
2525
$this->expectedValue = $expectedValue;
2626
$this->transport = $transport;

0 commit comments

Comments
 (0)