100% of 129OPs |
100% of 22Lines |
88% of 8Branches |
100% of 8Paths |
| Method | OPs | OPs % | Lines | Line % | Branches | Branches % | Paths | Path % |
|---|---|---|---|---|---|---|---|---|
| mageekguy\atoum\report\fields\runner\php\path\cli::__construct() | 22 | 100% | 6 | 100% | 1 | 0% | 1 | 100% |
| mageekguy\atoum\report\fields\runner\php\path\cli::__toString() | 41 | 100% | 7 | 100% | 1 | 100% | 1 | 100% |
| mageekguy\atoum\report\fields\runner\php\path\cli::setPrompt() | 16 | 100% | 2 | 100% | 1 | 100% | 1 | 100% |
| mageekguy\atoum\report\fields\runner\php\path\cli::getPrompt() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
| mageekguy\atoum\report\fields\runner\php\path\cli::setTitleColorizer() | 16 | 100% | 2 | 100% | 1 | 100% | 1 | 100% |
| mageekguy\atoum\report\fields\runner\php\path\cli::getTitleColorizer() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
| mageekguy\atoum\report\fields\runner\php\path\cli::setPathColorizer() | 16 | 100% | 2 | 100% | 1 | 100% | 1 | 100% |
| mageekguy\atoum\report\fields\runner\php\path\cli::getPathColorizer() | 6 | 100% | 1 | 100% | 1 | 100% | 1 | 100% |
| # | |
|---|---|
| 1 |
<?php |
| 2 | |
| 3 |
namespace mageekguy\atoum\report\fields\runner\php\path; |
| 4 | |
| 5 |
use |
| 6 |
mageekguy\atoum, |
| 7 |
mageekguy\atoum\report, |
| 8 |
mageekguy\atoum\locale, |
| 9 |
mageekguy\atoum\cli\prompt, |
| 10 |
mageekguy\atoum\cli\colorizer |
| 11 |
; |
| 12 | |
| 13 |
class cli extends report\fields\runner\php\path |
| 14 |
{
|
| 15 |
protected $prompt = null; |
| 16 |
protected $titleColorizer = null; |
| 17 |
protected $pathColorizer = null; |
| 18 | |
| 19 |
public function __construct()100% |
| 20 |
{
|
| 21 |
parent::__construct(); |
| 22 | |
| 23 |
$this |
| 24 |
->setPrompt() |
| 25 |
->setTitleColorizer() |
| 26 |
->setPathColorizer() |
| 27 |
; |
| 28 |
} |
| 29 | |
| 30 |
public function __toString()100% |
| 31 |
{
|
| 32 |
return |
| 33 |
$this->prompt . |
| 34 |
sprintf( |
| 35 |
$this->locale->_('%1$s: %2$s'),
|
| 36 |
$this->titleColorizer->colorize($this->locale->_('PHP path')),
|
| 37 |
$this->pathColorizer->colorize($this->path) |
| 38 |
) . |
| 39 |
PHP_EOL |
| 40 |
; |
| 41 |
} |
| 42 | |
| 43 |
public function setPrompt(prompt $prompt = null)100% |
| 44 |
{
|
| 45 |
$this->prompt = $prompt ?: new prompt(); |
| 46 | |
| 47 |
return $this; |
| 48 |
} |
| 49 | |
| 50 |
public function getPrompt()100% |
| 51 |
{
|
| 52 |
return $this->prompt; |
| 53 |
} |
| 54 | |
| 55 |
public function setTitleColorizer(colorizer $colorizer = null)100% |
| 56 |
{
|
| 57 |
$this->titleColorizer = $colorizer ?: new colorizer(); |
| 58 | |
| 59 |
return $this; |
| 60 |
} |
| 61 | |
| 62 |
public function getTitleColorizer()100% |
| 63 |
{
|
| 64 |
return $this->titleColorizer; |
| 65 |
} |
| 66 | |
| 67 |
public function setPathColorizer(colorizer $colorizer = null)100% |
| 68 |
{
|
| 69 |
$this->pathColorizer = $colorizer ?: new colorizer(); |
| 70 | |
| 71 |
return $this; |
| 72 |
} |
| 73 | |
| 74 |
public function getPathColorizer()100% |
| 75 |
{
|
| 76 |
return $this->pathColorizer; |
| 77 |
} |
| 78 |
} |