Fix implicitly nullable type declarations in SwiftMailer

SwiftMailer는 지원이 종료되었으므로 차기 버전에서 Symfony Mailer로 교체 예정
This commit is contained in:
Kijin Sung 2025-09-05 15:46:49 +09:00
parent 629c2ab73a
commit c643e80447
20 changed files with 21 additions and 21 deletions

View file

@ -106,7 +106,7 @@ class Swift_Encoder_QpEncoder implements Swift_Encoder
* @param Swift_CharacterStream $charStream to use for reading characters
* @param Swift_StreamFilter $filter if input should be canonicalized
*/
public function __construct(Swift_CharacterStream $charStream, Swift_StreamFilter $filter = null)
public function __construct(Swift_CharacterStream $charStream, ?Swift_StreamFilter $filter = null)
{
$this->charStream = $charStream;
if (!isset(self::$safeMapShare[$this->getSafeMapShareId()])) {

View file

@ -56,7 +56,7 @@ interface Swift_KeyCache
*
* @return Swift_InputByteStream
*/
public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $is = null);
public function getInputByteStream($nsKey, $itemKey, ?Swift_InputByteStream $is = null);
/**
* Get data back out of the cache as a string.

View file

@ -105,7 +105,7 @@ class Swift_KeyCache_ArrayKeyCache implements Swift_KeyCache
*
* @return Swift_InputByteStream
*/
public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null)
public function getInputByteStream($nsKey, $itemKey, ?Swift_InputByteStream $writeThrough = null)
{
$is = clone $this->stream;
$is->setKeyCache($this);

View file

@ -128,7 +128,7 @@ class Swift_KeyCache_DiskKeyCache implements Swift_KeyCache
*
* @return Swift_InputByteStream
*/
public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null)
public function getInputByteStream($nsKey, $itemKey, ?Swift_InputByteStream $writeThrough = null)
{
$is = clone $this->stream;
$is->setKeyCache($this);

View file

@ -52,7 +52,7 @@ class Swift_KeyCache_NullKeyCache implements Swift_KeyCache
*
* @return Swift_InputByteStream
*/
public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null)
public function getInputByteStream($nsKey, $itemKey, ?Swift_InputByteStream $writeThrough = null)
{
}

View file

@ -49,7 +49,7 @@ class Swift_KeyCache_SimpleKeyCacheInputStream implements Swift_KeyCache_KeyCach
* @param string $bytes
* @param Swift_InputByteStream $is optional
*/
public function write($bytes, Swift_InputByteStream $is = null)
public function write($bytes, ?Swift_InputByteStream $is = null)
{
$this->keyCache->setString(
$this->nsKey, $this->itemKey, $bytes, Swift_KeyCache::MODE_APPEND

View file

@ -24,7 +24,7 @@ class Swift_Mime_ContentEncoder_QpContentEncoder extends Swift_Encoder_QpEncoder
* @param Swift_StreamFilter $filter if canonicalization should occur
* @param bool $dotEscape if dot stuffing workaround must be enabled
*/
public function __construct(Swift_CharacterStream $charStream, Swift_StreamFilter $filter = null, $dotEscape = false)
public function __construct(Swift_CharacterStream $charStream, ?Swift_StreamFilter $filter = null, $dotEscape = false)
{
$this->dotEscape = $dotEscape;
parent::__construct($charStream, $filter);

View file

@ -200,7 +200,7 @@ abstract class Swift_Mime_Headers_AbstractHeader implements Swift_Mime_Header
*
* @return string
*/
protected function createPhrase(Swift_Mime_Header $header, $string, $charset, Swift_Mime_HeaderEncoder $encoder = null, $shorten = false)
protected function createPhrase(Swift_Mime_Header $header, $string, $charset, ?Swift_Mime_HeaderEncoder $encoder = null, $shorten = false)
{
// Treat token as exactly what was given
$phraseStr = $string;

View file

@ -42,7 +42,7 @@ class Swift_Mime_Headers_IdentificationHeader extends Swift_Mime_Headers_Abstrac
*
* @param string $name
*/
public function __construct($name, EmailValidator $emailValidator, Swift_AddressEncoder $addressEncoder = null)
public function __construct($name, EmailValidator $emailValidator, ?Swift_AddressEncoder $addressEncoder = null)
{
$this->setFieldName($name);
$this->emailValidator = $emailValidator;

View file

@ -39,7 +39,7 @@ class Swift_Mime_Headers_MailboxHeader extends Swift_Mime_Headers_AbstractHeader
*
* @param string $name of Header
*/
public function __construct($name, Swift_Mime_HeaderEncoder $encoder, EmailValidator $emailValidator, Swift_AddressEncoder $addressEncoder = null)
public function __construct($name, Swift_Mime_HeaderEncoder $encoder, EmailValidator $emailValidator, ?Swift_AddressEncoder $addressEncoder = null)
{
$this->setFieldName($name);
$this->setEncoder($encoder);

View file

@ -41,7 +41,7 @@ class Swift_Mime_Headers_ParameterizedHeader extends Swift_Mime_Headers_Unstruct
*
* @param string $name
*/
public function __construct($name, Swift_Mime_HeaderEncoder $encoder, Swift_Encoder $paramEncoder = null)
public function __construct($name, Swift_Mime_HeaderEncoder $encoder, ?Swift_Encoder $paramEncoder = null)
{
parent::__construct($name, $encoder);
$this->paramEncoder = $paramEncoder;

View file

@ -39,7 +39,7 @@ class Swift_Mime_Headers_PathHeader extends Swift_Mime_Headers_AbstractHeader
*
* @param string $name
*/
public function __construct($name, EmailValidator $emailValidator, Swift_AddressEncoder $addressEncoder = null)
public function __construct($name, EmailValidator $emailValidator, ?Swift_AddressEncoder $addressEncoder = null)
{
$this->setFieldName($name);
$this->emailValidator = $emailValidator;

View file

@ -37,7 +37,7 @@ class Swift_Mime_SimpleHeaderFactory implements Swift_Mime_CharsetObserver
*
* @param string|null $charset
*/
public function __construct(Swift_Mime_HeaderEncoder $encoder, Swift_Encoder $paramEncoder, EmailValidator $emailValidator, $charset = null, Swift_AddressEncoder $addressEncoder = null)
public function __construct(Swift_Mime_HeaderEncoder $encoder, Swift_Encoder $paramEncoder, EmailValidator $emailValidator, $charset = null, ?Swift_AddressEncoder $addressEncoder = null)
{
$this->encoder = $encoder;
$this->paramEncoder = $paramEncoder;
@ -72,7 +72,7 @@ class Swift_Mime_SimpleHeaderFactory implements Swift_Mime_CharsetObserver
*
* @return Swift_Mime_Header
*/
public function createDateHeader($name, DateTimeInterface $dateTime = null)
public function createDateHeader($name, ?DateTimeInterface $dateTime = null)
{
$header = new Swift_Mime_Headers_DateHeader($name);
if (isset($dateTime)) {

View file

@ -76,7 +76,7 @@ class Swift_Mime_SimpleHeaderSet implements Swift_Mime_CharsetObserver
*
* @param string $name
*/
public function addDateHeader($name, DateTimeInterface $dateTime = null)
public function addDateHeader($name, ?DateTimeInterface $dateTime = null)
{
$this->storeHeader($name, $this->factory->createDateHeader($name, $dateTime));
}

View file

@ -50,7 +50,7 @@ class Swift_Plugins_AntiFloodPlugin implements Swift_Events_SendListener, Swift_
* @param int $sleep time
* @param Swift_Plugins_Sleeper $sleeper (not needed really)
*/
public function __construct($threshold = 99, $sleep = 0, Swift_Plugins_Sleeper $sleeper = null)
public function __construct($threshold = 99, $sleep = 0, ?Swift_Plugins_Sleeper $sleeper = null)
{
$this->setThreshold($threshold);
$this->setSleepTime($sleep);

View file

@ -76,7 +76,7 @@ class Swift_Plugins_ThrottlerPlugin extends Swift_Plugins_BandwidthMonitorPlugin
* @param Swift_Plugins_Sleeper $sleeper (only needed in testing)
* @param Swift_Plugins_Timer $timer (only needed in testing)
*/
public function __construct($rate, $mode = self::BYTES_PER_MINUTE, Swift_Plugins_Sleeper $sleeper = null, Swift_Plugins_Timer $timer = null)
public function __construct($rate, $mode = self::BYTES_PER_MINUTE, ?Swift_Plugins_Sleeper $sleeper = null, ?Swift_Plugins_Timer $timer = null)
{
$this->rate = $rate;
$this->mode = $mode;

View file

@ -46,7 +46,7 @@ abstract class Swift_Transport_AbstractSmtpTransport implements Swift_Transport
*
* @param string $localDomain
*/
public function __construct(Swift_Transport_IoBuffer $buf, Swift_Events_EventDispatcher $dispatcher, $localDomain = '127.0.0.1', Swift_AddressEncoder $addressEncoder = null)
public function __construct(Swift_Transport_IoBuffer $buf, Swift_Events_EventDispatcher $dispatcher, $localDomain = '127.0.0.1', ?Swift_AddressEncoder $addressEncoder = null)
{
$this->buffer = $buf;
$this->eventDispatcher = $dispatcher;

View file

@ -51,7 +51,7 @@ class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTranspo
* @param Swift_Transport_EsmtpHandler[] $extensionHandlers
* @param string $localDomain
*/
public function __construct(Swift_Transport_IoBuffer $buf, array $extensionHandlers, Swift_Events_EventDispatcher $dispatcher, $localDomain = '127.0.0.1', Swift_AddressEncoder $addressEncoder = null)
public function __construct(Swift_Transport_IoBuffer $buf, array $extensionHandlers, Swift_Events_EventDispatcher $dispatcher, $localDomain = '127.0.0.1', ?Swift_AddressEncoder $addressEncoder = null)
{
parent::__construct($buf, $dispatcher, $localDomain, $addressEncoder);
$this->setExtensionHandlers($extensionHandlers);

View file

@ -36,7 +36,7 @@ class Swift_Transport_SendmailTransport extends Swift_Transport_AbstractSmtpTran
*
* @param string $localDomain
*/
public function __construct(Swift_Transport_IoBuffer $buf, Swift_Events_EventDispatcher $dispatcher, $localDomain = '127.0.0.1', Swift_AddressEncoder $addressEncoder = null)
public function __construct(Swift_Transport_IoBuffer $buf, Swift_Events_EventDispatcher $dispatcher, $localDomain = '127.0.0.1', ?Swift_AddressEncoder $addressEncoder = null)
{
parent::__construct($buf, $dispatcher, $localDomain, $addressEncoder);
}

View file

@ -24,7 +24,7 @@ class Swift_Transport_SpoolTransport implements Swift_Transport
/**
* Constructor.
*/
public function __construct(Swift_Events_EventDispatcher $eventDispatcher, Swift_Spool $spool = null)
public function __construct(Swift_Events_EventDispatcher $eventDispatcher, ?Swift_Spool $spool = null)
{
$this->eventDispatcher = $eventDispatcher;
$this->spool = $spool;