100% of 37OPs |
100% of 6Lines |
75% of 4Branches |
100% of 4Paths |
Method | OPs | OPs % | Lines | Line % | Branches | Branches % | Paths | Path % |
---|---|---|---|---|---|---|---|---|
mageekguy\atoum\writer\decorators\prompt::__construct() | 10 | 100% | 2 | 100% | 1 | 0% | 1 | 100% |
mageekguy\atoum\writer\decorators\prompt::setPrompt() | 13 | 100% | 2 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\writer\decorators\prompt::getPrompt() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
mageekguy\atoum\writer\decorators\prompt::decorate() | 8 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
# | |
---|---|
1 |
<?php |
2 | |
3 |
namespace mageekguy\atoum\writer\decorators; |
4 | |
5 |
use |
6 |
mageekguy\atoum\writer |
7 |
; |
8 | |
9 |
class prompt implements writer\decorator |
10 |
{ |
11 |
const defaultPrompt = '$ '; |
12 | |
13 |
protected $prompt = ''; |
14 | |
15 |
public function __construct($prompt = null)100% |
16 |
{ |
17 |
$this->setPrompt($prompt); |
18 |
} |
19 | |
20 |
public function setPrompt($prompt = null)100% |
21 |
{ |
22 |
$this->prompt = $prompt ?: static::defaultPrompt; |
23 | |
24 |
return $this; |
25 |
} |
26 | |
27 |
public function getPrompt()100% |
28 |
{ |
29 |
return $this->prompt; |
30 |
} |
31 | |
32 |
public function decorate($message)100% |
33 |
{ |
34 |
return $this->prompt . $message; |
35 |
} |
36 |
} |