Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
75.00% |
3 / 4 |
CRAP | |
81.82% |
9 / 11 |
SingleLinkedListNode | |
0.00% |
0 / 1 |
|
75.00% |
3 / 4 |
5.15 | |
81.82% |
9 / 11 |
__construct | |
100.00% |
1 / 1 |
1 | |
100.00% |
3 / 3 |
|||
get | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
set | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
next | |
100.00% |
1 / 1 |
2 | |
100.00% |
5 / 5 |
<?php namespace Mtkocak\DataStructures; | |
class SingleLinkedListNode implements DataStructureNode | |
{ | |
private $data; | |
public $next; | |
function __construct($data) | |
{ | |
$this->data = $data; | |
$this->next = NULL; | |
} | |
public function get() | |
{ | |
return $this->data; | |
} | |
public function set($value) | |
{ | |
$this->data = $value; | |
return $this->data; | |
} | |
public function next(DataStructureNode $node = NULL) | |
{ | |
if(isset($node)) | |
{ | |
$this->next = $node; | |
} | |
return $this->next; | |
} | |
} |