84% of 108OPs |
94% of 18Lines |
72% of 18Branches |
60% of 10Paths |
Method | OPs | OPs % | Lines | Line % | Branches | Branches % | Paths | Path % |
---|---|---|---|---|---|---|---|---|
mageekguy\atoum\php\tokenizer\iterators\phpFunction::getName() | 56 | 100% | 12 | 100% | 10 | 100% | 5 | 60% |
mageekguy\atoum\php\tokenizer\iterators\phpFunction::reset() | 14 | 100% | 2 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\php\tokenizer\iterators\phpFunction::appendArgument() | 15 | 100% | 2 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\php\tokenizer\iterators\phpFunction::getArguments() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\php\tokenizer\iterators\phpFunction::getArgument() | 17 | 0% | 1 | 0% | 5 | 0% | 2 | 0% |
# | |
---|---|
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 phpFunction extends tokenizer\iterator |
12 |
{ |
13 |
protected $arguments = array(); |
14 |
|
15 |
public function getName()100% |
16 |
{ |
17 |
$name = null; |
18 |
|
19 |
$key = $this->findTag(T_FUNCTION); |
20 |
|
21 |
if ($key !== null) |
22 |
{ |
23 |
$this->goToNextTagWhichIsNot(array(T_WHITESPACE, T_COMMENT)); |
24 |
|
25 |
$token = $this->current(); |
26 |
|
27 |
if ($token !== null && $token->getTag() === T_STRING) |
28 |
{ |
29 |
$name = $token->getValue(); |
30 |
} |
31 |
} |
32 |
|
33 |
return $name; |
34 |
} |
35 |
|
36 |
public function reset()100% |
37 |
{ |
38 |
$this->arguments = array(); |
39 |
|
40 |
return parent::reset(); |
41 |
} |
42 |
|
43 |
public function appendArgument(iterators\phpArgument $phpArgument)100% |
44 |
{ |
45 |
$this->arguments[] = $phpArgument; |
46 |
|
47 |
return $this->append($phpArgument); |
48 |
} |
49 |
|
50 |
public function getArguments()100% |
51 |
{ |
52 |
return $this->arguments; |
53 |
} |
54 |
|
55 |
public function getArgument($index)0% |
56 |
{ |
57 |
return (isset($this->arguments[$index]) === false ? null : $this->arguments[$index]); |
58 |
} |
59 |
} |