73% of 55OPs |
100% of 11Lines |
67% of 9Branches |
25% of 4Paths |
| Method | OPs | OPs % | Lines | Line % | Branches | Branches % | Paths | Path % |
|---|---|---|---|---|---|---|---|---|
| mageekguy\atoum\test\adapter\calls\decorator::decorate() | 55 | 73% | 11 | 100% | 9 | 67% | 4 | 25% |
| # | |
|---|---|
| 1 |
<?php |
| 2 |
|
| 3 |
namespace mageekguy\atoum\test\adapter\calls; |
| 4 |
|
| 5 |
use |
| 6 |
mageekguy\atoum\test\adapter\calls |
| 7 |
; |
| 8 |
|
| 9 |
class decorator |
| 10 |
{
|
| 11 |
public function decorate(calls $calls)100% |
| 12 |
{
|
| 13 |
$string = ''; |
| 14 |
|
| 15 |
$sizeOfCalls = sizeof($calls); |
| 16 |
|
| 17 |
if ($sizeOfCalls > 0) |
| 18 |
{
|
| 19 |
$format = '[%' . strlen((string) $sizeOfCalls) . 's] %s'; |
| 20 |
|
| 21 |
$position = 1; |
| 22 |
|
| 23 |
foreach ($calls->getTimeline() as $call) |
| 24 |
{
|
| 25 |
$string .= sprintf($format, $position++, $call) . PHP_EOL; |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
return $string; |
| 30 |
} |
| 31 |
} |