mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 19:48:49 +02:00
N°5809 Update laminas/laminas-mail from 2.16.0 to 2.22.0
This commit is contained in:
@@ -4,14 +4,13 @@ declare(strict_types=1);
|
||||
|
||||
namespace Laminas\Stdlib;
|
||||
|
||||
use ReturnTypeWillChange;
|
||||
use Serializable;
|
||||
use UnexpectedValueException;
|
||||
|
||||
use function array_key_exists;
|
||||
use function get_class;
|
||||
use function gettype;
|
||||
use function get_debug_type;
|
||||
use function is_array;
|
||||
use function is_object;
|
||||
use function serialize;
|
||||
use function sprintf;
|
||||
use function unserialize;
|
||||
@@ -24,9 +23,8 @@ use const PHP_INT_MAX;
|
||||
* Also, provides predictable heap order for datums added with the same priority
|
||||
* (i.e., they will be emitted in the same order they are enqueued).
|
||||
*
|
||||
* @psalm-type InternalPriority = array{0: mixed, 1: int}
|
||||
* @template TValue
|
||||
* @template TPriority of InternalPriority
|
||||
* @template TPriority of int
|
||||
* @extends \SplPriorityQueue<TPriority, TValue>
|
||||
*/
|
||||
class SplPriorityQueue extends \SplPriorityQueue implements Serializable
|
||||
@@ -40,19 +38,18 @@ class SplPriorityQueue extends \SplPriorityQueue implements Serializable
|
||||
* Utilizes {@var $serial} to ensure that values of equal priority are
|
||||
* emitted in the same order in which they are inserted.
|
||||
*
|
||||
* @param TValue $datum
|
||||
* @param TPriority|mixed $priority
|
||||
* @param TValue $value
|
||||
* @param TPriority $priority
|
||||
* @return void
|
||||
*/
|
||||
public function insert($datum, $priority)
|
||||
#[ReturnTypeWillChange] // Inherited return type should be bool
|
||||
public function insert($value, $priority)
|
||||
{
|
||||
if (! is_array($priority)) {
|
||||
$priority = [$priority, $this->serial--];
|
||||
}
|
||||
|
||||
/** @psalm-var TPriority $priority */
|
||||
|
||||
parent::insert($datum, $priority);
|
||||
parent::insert($value, $priority);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,7 +117,7 @@ class SplPriorityQueue extends \SplPriorityQueue implements Serializable
|
||||
/**
|
||||
* Magic method used to rebuild an instance.
|
||||
*
|
||||
* @param array $data Data array.
|
||||
* @param array<array-key, mixed> $data Data array.
|
||||
* @return void
|
||||
*/
|
||||
public function __unserialize($data)
|
||||
@@ -132,7 +129,7 @@ class SplPriorityQueue extends \SplPriorityQueue implements Serializable
|
||||
throw new UnexpectedValueException(sprintf(
|
||||
'Cannot deserialize %s instance: corrupt item; expected array, received %s',
|
||||
self::class,
|
||||
is_object($item) ? get_class($item) : gettype($item)
|
||||
get_debug_type($item)
|
||||
));
|
||||
}
|
||||
|
||||
@@ -148,8 +145,6 @@ class SplPriorityQueue extends \SplPriorityQueue implements Serializable
|
||||
$priority = (int) $item['priority'];
|
||||
}
|
||||
|
||||
/** @psalm-var TValue $item['data'] */
|
||||
|
||||
$this->insert($item['data'], $priority);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user