Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
PriorityQueue
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 to_array
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2namespace NewfoldLabs\WP\Module\Installer\Models;
3
4/**
5 * Max heap implementation of a Priority Queue.
6 */
7class PriorityQueue extends \SplPriorityQueue {
8
9    /**
10     * Converts the max heap to an array.
11     *
12     * @return array
13     */
14    public function to_array() {
15        $array = array();
16        while ( $this->valid() ) {
17            array_push( $array, $this->extract() );
18        }
19        return $array;
20    }
21}