Skip to content

Commit

Permalink
apply fix
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhu committed Feb 14, 2024
1 parent 4c13d5d commit 383ae4e
Show file tree
Hide file tree
Showing 193 changed files with 1,290 additions and 1,390 deletions.
2 changes: 1 addition & 1 deletion lib/classes/Swift.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
abstract class Swift
{
const VERSION = '6.3.0';
public const VERSION = '6.3.0';

public static $initialized = false;
public static $inits = [];
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/Swift/Attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct($data = null, $filename = null, $contentType = null)
'Swift_Mime_Attachment::__construct',
Swift_DependencyContainer::getInstance()
->createDependenciesFor('mime.attachment')
);
);

$this->setBody($data, $contentType);
$this->setFilename($filename);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ public function removeFilter($key)
*
* @param string $bytes
*
* @throws Swift_IoException
*
* @return int
*
* @throws Swift_IoException
*/
public function write($bytes)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/Swift/ByteStream/FileByteStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Swift_ByteStream_FileByteStream extends Swift_ByteStream_AbstractFilterabl
private $writer;

/** If stream is seekable true/false, or null if not known */
private $seekable = null;
private $seekable;

/**
* Create a new FileByteStream for $path.
Expand Down
4 changes: 2 additions & 2 deletions lib/classes/Swift/ByteStream/TemporaryFileByteStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ public function __destruct()

public function __sleep()
{
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
throw new BadMethodCallException('Cannot serialize '.__CLASS__);
}

public function __wakeup()
{
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
throw new BadMethodCallException('Cannot unserialize '.__CLASS__);
}
}
7 changes: 3 additions & 4 deletions lib/classes/Swift/CharacterReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@
*/
interface Swift_CharacterReader
{
const MAP_TYPE_INVALID = 0x01;
const MAP_TYPE_FIXED_LEN = 0x02;
const MAP_TYPE_POSITIONS = 0x03;
public const MAP_TYPE_INVALID = 0x01;
public const MAP_TYPE_FIXED_LEN = 0x02;
public const MAP_TYPE_POSITIONS = 0x03;

/**
* Returns the complete character map.
*
* @param string $string
* @param int $startOffset
* @param array $currentMap
* @param mixed $ignoredChars
*
* @return int
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public function __construct($width)
* @param string $string
* @param int $startOffset
* @param array $currentMap
* @param mixed $ignoredChars
*
* @return int
*/
Expand Down
1 change: 0 additions & 1 deletion lib/classes/Swift/CharacterReader/Utf8Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ class Swift_CharacterReader_Utf8Reader implements Swift_CharacterReader
* @param string $string
* @param int $startOffset
* @param array $currentMap
* @param mixed $ignoredChars
*
* @return int
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function init()
'constructor' => [],
];

//7-8 bit charsets
// 7-8 bit charsets
self::$map['(us-)?ascii'] = $singleByte;
self::$map['(iso|iec)-?8859-?[0-9]+'] = $singleByte;
self::$map['windows-?125[0-9]'] = $singleByte;
Expand All @@ -84,10 +84,10 @@ public function init()
self::$map['(cork|t1)'] = $singleByte;
self::$map['v?iscii'] = $singleByte;

//16 bits
// 16 bits
self::$map['(ucs-?2|utf-?16)'] = $doubleByte;

//32 bits
// 32 bits
self::$map['(ucs-?4|utf-?32)'] = $fourBytes;

// Fallback
Expand Down
4 changes: 2 additions & 2 deletions lib/classes/Swift/CharacterStream/ArrayCharacterStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ public function importByteStream(Swift_OutputByteStream $os)
$size = \count($c);
$need = $this->charReader
->validateByteSequence($c, $size);
if ($need > 0 &&
false !== $bytes = $os->read($need)) {
if ($need > 0
&& false !== $bytes = $os->read($need)) {
for ($i = 0, $len = \strlen($bytes); $i < $len; ++$i) {
$c[] = self::$byteMap[$bytes[$i]];
}
Expand Down
6 changes: 2 additions & 4 deletions lib/classes/Swift/CharacterStream/NgCharacterStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ class Swift_CharacterStream_NgCharacterStream implements Swift_CharacterStream

/**
* Map.
*
* @var mixed
*/
private $map;

Expand Down Expand Up @@ -165,8 +163,8 @@ public function read($length)
case Swift_CharacterReader::MAP_TYPE_FIXED_LEN:
$len = $length * $this->map;
$ret = substr($this->datas,
$this->currentPos * $this->map,
$len);
$this->currentPos * $this->map,
$len);
$this->currentPos += $length;
break;

Expand Down
20 changes: 7 additions & 13 deletions lib/classes/Swift/DependencyContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@
class Swift_DependencyContainer
{
/** Constant for literal value types */
const TYPE_VALUE = 0x00001;
public const TYPE_VALUE = 0x00001;

/** Constant for new instance types */
const TYPE_INSTANCE = 0x00010;
public const TYPE_INSTANCE = 0x00010;

/** Constant for shared instance types */
const TYPE_SHARED = 0x00100;
public const TYPE_SHARED = 0x00100;

/** Constant for aliases */
const TYPE_ALIAS = 0x01000;
public const TYPE_ALIAS = 0x01000;

/** Constant for arrays */
const TYPE_ARRAY = 0x10000;
public const TYPE_ARRAY = 0x10000;

/** Singleton instance */
private static $instance = null;
private static $instance;

/** The data container */
private $store = [];
Expand Down Expand Up @@ -94,8 +94,6 @@ public function has($itemName)
*
* @param string $itemName
*
* @return mixed
*
* @throws Swift_DependencyException If the dependency is not found
*/
public function lookup($itemName)
Expand Down Expand Up @@ -161,8 +159,6 @@ public function register($itemName)
*
* {@link register()} must be called before this will work.
*
* @param mixed $value
*
* @return $this
*/
public function asValue($value)
Expand Down Expand Up @@ -271,8 +267,6 @@ public function withDependencies(array $lookups)
*
* @see withDependencies(), addConstructorLookup()
*
* @param mixed $value
*
* @return $this
*/
public function addConstructorValue($value)
Expand Down Expand Up @@ -326,7 +320,7 @@ private function createNewInstance($itemName)
if ($reflector->getConstructor()) {
return $reflector->newInstanceArgs(
$this->createDependenciesFor($itemName)
);
);
}

return $reflector->newInstance();
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/Swift/EmbeddedFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct($data = null, $filename = null, $contentType = null)
'Swift_Mime_EmbeddedFile::__construct',
Swift_DependencyContainer::getInstance()
->createDependenciesFor('mime.embeddedfile')
);
);

$this->setBody($data);
$this->setFilename($filename);
Expand Down
4 changes: 2 additions & 2 deletions lib/classes/Swift/Encoder/Base64Encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0)
if (0 != $firstLineOffset) {
$firstLine = substr(
$encodedString, 0, $maxLineLength - $firstLineOffset
)."\r\n";
)."\r\n";
$encodedString = substr(
$encodedString, $maxLineLength - $firstLineOffset
);
);
}

return $firstLine.trim(chunk_split($encodedString, $maxLineLength, "\r\n"));
Expand Down
4 changes: 2 additions & 2 deletions lib/classes/Swift/Encoder/QpEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()])) {
Expand Down Expand Up @@ -280,7 +280,7 @@ protected function standardize($string)
{
$string = str_replace(["\t=0D=0A", ' =0D=0A', '=0D=0A'],
["=09\r\n", "=20\r\n", "\r\n"], $string
);
);
switch ($end = \ord(substr($string, -1))) {
case 0x09:
case 0x20:
Expand Down
2 changes: 0 additions & 2 deletions lib/classes/Swift/Events/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ public function getSource();

/**
* Prevent this Event from bubbling any further up the stack.
*
* @param bool $cancel, optional
*/
public function cancelBubble($cancel = true);

Expand Down
10 changes: 5 additions & 5 deletions lib/classes/Swift/Events/SendEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
class Swift_Events_SendEvent extends Swift_Events_EventObject
{
/** Sending has yet to occur */
const RESULT_PENDING = 0x0001;
public const RESULT_PENDING = 0x0001;

/** Email is spooled, ready to be sent */
const RESULT_SPOOLED = 0x0011;
public const RESULT_SPOOLED = 0x0011;

/** Sending was successful */
const RESULT_SUCCESS = 0x0010;
public const RESULT_SUCCESS = 0x0010;

/** Sending worked, but there were some failures */
const RESULT_TENTATIVE = 0x0100;
public const RESULT_TENTATIVE = 0x0100;

/** Sending failed */
const RESULT_FAILED = 0x1000;
public const RESULT_FAILED = 0x1000;

/**
* The Message being sent.
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/Swift/FailoverTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct($transports = [])
'Swift_Transport_FailoverTransport::__construct',
Swift_DependencyContainer::getInstance()
->createDependenciesFor('transport.failover')
);
);

$this->setTransports($transports);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/classes/Swift/FileSpool.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ public function setRetryLimit($limit)
*
* @param Swift_Mime_SimpleMessage $message The message to store
*
* @throws Swift_IoException
*
* @return bool
*
* @throws Swift_IoException
*/
public function queueMessage(Swift_Mime_SimpleMessage $message)
{
Expand Down
8 changes: 2 additions & 6 deletions lib/classes/Swift/InputByteStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ interface Swift_InputByteStream
*
* @param string $bytes
*
* @throws Swift_IoException
*
* @return int
*
* @throws Swift_IoException
*/
public function write($bytes);

Expand All @@ -49,8 +49,6 @@ public function commit();
*
* The stream acts as an observer, receiving all data that is written.
* All {@link write()} and {@link flushBuffers()} operations will be mirrored.
*
* @param Swift_InputByteStream $is
*/
public function bind(self $is);

Expand All @@ -60,8 +58,6 @@ public function bind(self $is);
* If $is is not bound, no errors will be raised.
* If the stream currently has any buffered data it will be written to $is
* before unbinding occurs.
*
* @param Swift_InputByteStream $is
*/
public function unbind(self $is);

Expand Down
2 changes: 1 addition & 1 deletion lib/classes/Swift/IoException.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Swift_IoException extends Swift_SwiftException
* @param string $message
* @param int $code
*/
public function __construct($message, $code = 0, Exception $previous = null)
public function __construct($message, $code = 0, ?Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/classes/Swift/KeyCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
interface Swift_KeyCache
{
/** Mode for replacing existing cached data */
const MODE_WRITE = 1;
public const MODE_WRITE = 1;

/** Mode for appending data to the end of existing cached data */
const MODE_APPEND = 2;
public const MODE_APPEND = 2;

/**
* Set a string into the cache under $itemKey for the namespace $nsKey.
Expand Down Expand Up @@ -56,7 +56,7 @@ public function importFromByteStream($nsKey, $itemKey, Swift_OutputByteStream $o
*
* @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.
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/Swift/KeyCache/ArrayKeyCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function importFromByteStream($nsKey, $itemKey, Swift_OutputByteStream $o
*
* @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);
Expand Down
Loading

0 comments on commit 383ae4e

Please sign in to comment.