public function merge(self $queue): void
    {
        $data = $queue->toArray();

        foreach ($data as $item) {
            $this->insert($item['data'], $item['priority']);
        }
    }
public function merge(self $queue): void
    {
        $data = $queue->toArray();

        foreach ($data as $item) {
            $this->insert($item['data'], $item['priority']);
        }
    }
public function merge ( self $ queue ) : void { $ data = $ queue -> toArray ( ) ; foreach ( $ data as $ item ) { $ this -> insert ( $ item [ 'data' ] , $ item [ 'priority' ] ) ; } }
Merges the given queue data into this queue.

@param PriorityQueue $queue The queue to merge
@return void
Merges the given queue data into this queue .