Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
4 / 4 |
Queue | |
100.00% |
1 / 1 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
4 / 4 |
__construct() // [\SplQueue] | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
dequeue() // -> mixed [\SplQueue] | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
enqueue($value) // [\SplQueue] | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
<?php namespace SEIDS\LinkedLists\Singly; | |
//============================================================================== | |
// PHP SEIDS: Supplementary, Easily Interchangeable Data Structures | |
// | |
// Copyright 2015, Daniel A.C. Martin | |
// Distributed under the MIT License. | |
// (See LICENSE file for details.) | |
//============================================================================== | |
class Queue extends LinkedList | |
{ | |
//////////////////////////////////////////////////////////////////////////// | |
// Public methods - Implement the same interface as \SplQueue. | |
//////////////////////////////////////////////////////////////////////////// | |
public function __construct() // [\SplQueue] | |
{ | |
$this->flags = 4; // Note: I have no idea why SplQueue does this! | |
} | |
public function dequeue() // -> mixed [\SplQueue] | |
{ | |
return $this->shift(); | |
} | |
public function enqueue($value) // [\SplQueue] | |
{ | |
// SplQueue documentation claims that this function returns void but | |
// this does not seem to be the case! | |
return $this->push($value); | |
} | |
//public function setIteratorMode($mode) // [\SplQueue] | |
} | |