84% of 136OPs |
75% of 16Lines |
95% of 22Branches |
92% of 13Paths |
| # | |
|---|---|
| 1 |
<?php |
| 2 |
|
| 3 |
namespace mageekguy\atoum\php\tokenizer\iterators; |
| 4 |
|
| 5 |
use |
| 6 |
mageekguy\atoum\exceptions, |
| 7 |
mageekguy\atoum\php\tokenizer, |
| 8 |
mageekguy\atoum\php\tokenizer\iterators |
| 9 |
; |
| 10 |
|
| 11 |
class phpNamespace extends tokenizer\iterator |
| 12 |
{
|
| 13 |
protected $constants = array(); |
| 14 |
protected $functions = array(); |
| 15 |
protected $classes = array(); |
| 16 |
|
| 17 |
public function reset()0% |
| 18 |
{
|
| 19 |
$this->functions = array(); |
| 20 |
$this->constants = array(); |
| 21 |
$this->classes = array(); |
| 22 |
|
| 23 |
return parent::reset(); |
| 24 |
} |
| 25 |
|
| 26 |
public function getConstants()100% |
| 27 |
{
|
| 28 |
return $this->constants; |
| 29 |
} |
| 30 |
|
| 31 |
public function getConstant($index)100% |
| 32 |
{
|
| 33 |
return (isset($this->constants[$index]) === false ? null : $this->constants[$index]); |
| 34 |
} |
| 35 |
|
| 36 |
public function appendConstant(iterators\phpConstant $phpConstant)100% |
| 37 |
{
|
| 38 |
$this->constants[] = $phpConstant; |
| 39 |
|
| 40 |
return $this->append($phpConstant); |
| 41 |
} |
| 42 |
|
| 43 |
public function getClasses()100% |
| 44 |
{
|
| 45 |
return $this->classes; |
| 46 |
} |
| 47 |
|
| 48 |
public function getClass($index)100% |
| 49 |
{
|
| 50 |
return (isset($this->classes[$index]) === false ? null : $this->classes[$index]); |
| 51 |
} |
| 52 |
|
| 53 |
public function appendClass(iterators\phpClass $phpClass)100% |
| 54 |
{
|
| 55 |
$this->classes[] = $phpClass; |
| 56 |
|
| 57 |
return $this->append($phpClass); |
| 58 |
} |
| 59 |
|
| 60 |
public function getFunctions()100% |
| 61 |
{
|
| 62 |
return $this->functions; |
| 63 |
} |
| 64 |
|
| 65 |
public function getFunction($index)100% |
| 66 |
{
|
| 67 |
return (isset($this->functions[$index]) === false ? null : $this->functions[$index]); |
| 68 |
} |
| 69 |
|
| 70 |
public function appendFunction(iterators\phpFunction $phpFunction)100% |
| 71 |
{
|
| 72 |
$this->functions[] = $phpFunction; |
| 73 |
|
| 74 |
return $this->append($phpFunction); |
| 75 |
} |
| 76 |
} |