100% of 59OPs |
100% of 10Lines |
90% of 10Branches |
100% of 5Paths |
Method | OPs | OPs % | Lines | Line % | Branches | Branches % | Paths | Path % |
---|---|---|---|---|---|---|---|---|
mageekguy\atoum\test\adapter\call\decorators\addClass::__construct() | 30 | 100% | 3 | 100% | 5 | 80% | 2 | 100% |
mageekguy\atoum\test\adapter\call\decorators\addClass::getClass() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\test\adapter\call\decorators\addClass::decorate() | 23 | 100% | 6 | 100% | 4 | 100% | 2 | 100% |
# | |
---|---|
1 |
<?php |
2 |
|
3 |
namespace mageekguy\atoum\test\adapter\call\decorators; |
4 |
|
5 |
use |
6 |
mageekguy\atoum\test\adapter\call |
7 |
; |
8 |
|
9 |
class addClass extends call\decorator |
10 |
{ |
11 |
protected $class = ''; |
12 |
|
13 |
public function __construct($mixed)100% |
14 |
{ |
15 |
parent::__construct(); |
16 |
|
17 |
$this->class = (is_object($mixed) === false ? (string) $mixed : get_class($mixed)); |
18 |
} |
19 |
|
20 |
public function getClass()100% |
21 |
{ |
22 |
return $this->class; |
23 |
} |
24 |
|
25 |
public function decorate(call $call)100% |
26 |
{ |
27 |
$string = parent::decorate($call); |
28 |
|
29 |
if ($string !== '') |
30 |
{ |
31 |
$string = $this->class . '::' . $string; |
32 |
} |
33 |
|
34 |
return $string; |
35 |
} |
36 |
} |