Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
PriorityQueue
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
1 / 1
 to_array
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
2
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}