mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 23:32:17 +02:00
N°4307 Replace SwiftMailer with Laminas-mail
This commit is contained in:
54
lib/laminas/laminas-stdlib/src/SplQueue.php
Normal file
54
lib/laminas/laminas-stdlib/src/SplQueue.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @see https://github.com/laminas/laminas-stdlib for the canonical source repository
|
||||
* @copyright https://github.com/laminas/laminas-stdlib/blob/master/COPYRIGHT.md
|
||||
* @license https://github.com/laminas/laminas-stdlib/blob/master/LICENSE.md New BSD License
|
||||
*/
|
||||
|
||||
namespace Laminas\Stdlib;
|
||||
|
||||
use Serializable;
|
||||
|
||||
/**
|
||||
* Serializable version of SplQueue
|
||||
*/
|
||||
class SplQueue extends \SplQueue implements Serializable
|
||||
{
|
||||
/**
|
||||
* Return an array representing the queue
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray()
|
||||
{
|
||||
$array = [];
|
||||
foreach ($this as $item) {
|
||||
$array[] = $item;
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function serialize()
|
||||
{
|
||||
return serialize($this->toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* Unserialize
|
||||
*
|
||||
* @param string $data
|
||||
* @return void
|
||||
*/
|
||||
public function unserialize($data)
|
||||
{
|
||||
foreach (unserialize($data) as $item) {
|
||||
$this->push($item);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user