2
0
forked from Wavyzz/dolibarr

FIX: Update swiftmailer librairies

This commit is contained in:
kamel
2021-12-07 17:11:34 +01:00
parent bd52613331
commit 1ca199d796
156 changed files with 2370 additions and 1637 deletions

View File

@@ -20,7 +20,7 @@ class Swift_KeyCache_ArrayKeyCache implements Swift_KeyCache
*
* @var array
*/
private $contents = array();
private $contents = [];
/**
* An InputStream for cloning.
@@ -32,8 +32,6 @@ class Swift_KeyCache_ArrayKeyCache implements Swift_KeyCache
/**
* Create a new ArrayKeyCache with the given $stream for cloning to make
* InputByteStreams.
*
* @param Swift_KeyCache_KeyCacheInputStream $stream
*/
public function __construct(Swift_KeyCache_KeyCacheInputStream $stream)
{
@@ -64,10 +62,7 @@ class Swift_KeyCache_ArrayKeyCache implements Swift_KeyCache
$this->contents[$nsKey][$itemKey] .= $string;
break;
default:
throw new Swift_SwiftException(
'Invalid mode ['.$mode.'] used to set nsKey='.
$nsKey.', itemKey='.$itemKey
);
throw new Swift_SwiftException('Invalid mode ['.$mode.'] used to set nsKey='.$nsKey.', itemKey='.$itemKey);
}
}
@@ -76,10 +71,9 @@ class Swift_KeyCache_ArrayKeyCache implements Swift_KeyCache
*
* @see MODE_WRITE, MODE_APPEND
*
* @param string $nsKey
* @param string $itemKey
* @param Swift_OutputByteStream $os
* @param int $mode
* @param string $nsKey
* @param string $itemKey
* @param int $mode
*/
public function importFromByteStream($nsKey, $itemKey, Swift_OutputByteStream $os, $mode)
{
@@ -87,6 +81,7 @@ class Swift_KeyCache_ArrayKeyCache implements Swift_KeyCache
switch ($mode) {
case self::MODE_WRITE:
$this->clearKey($nsKey, $itemKey);
// no break
case self::MODE_APPEND:
if (!$this->hasKey($nsKey, $itemKey)) {
$this->contents[$nsKey][$itemKey] = '';
@@ -96,10 +91,7 @@ class Swift_KeyCache_ArrayKeyCache implements Swift_KeyCache
}
break;
default:
throw new Swift_SwiftException(
'Invalid mode ['.$mode.'] used to set nsKey='.
$nsKey.', itemKey='.$itemKey
);
throw new Swift_SwiftException('Invalid mode ['.$mode.'] used to set nsKey='.$nsKey.', itemKey='.$itemKey);
}
}
@@ -108,9 +100,8 @@ class Swift_KeyCache_ArrayKeyCache implements Swift_KeyCache
*
* NOTE: The stream will always write in append mode.
*
* @param string $nsKey
* @param string $itemKey
* @param Swift_InputByteStream $writeThrough
* @param string $nsKey
* @param string $itemKey
*
* @return Swift_InputByteStream
*/
@@ -168,7 +159,7 @@ class Swift_KeyCache_ArrayKeyCache implements Swift_KeyCache
{
$this->prepareCache($nsKey);
return array_key_exists($itemKey, $this->contents[$nsKey]);
return \array_key_exists($itemKey, $this->contents[$nsKey]);
}
/**
@@ -199,8 +190,8 @@ class Swift_KeyCache_ArrayKeyCache implements Swift_KeyCache
*/
private function prepareCache($nsKey)
{
if (!array_key_exists($nsKey, $this->contents)) {
$this->contents[$nsKey] = array();
if (!\array_key_exists($nsKey, $this->contents)) {
$this->contents[$nsKey] = [];
}
}
}