travis-ci
84 of 84 new or added lines in 5 files covered. (100.0%)
3256 of 5418 relevant lines covered (60.1%)
35.92 hits per line
1 |
<?php
|
|
2 |
namespace Robo\State; |
|
3 |
|
|
4 |
use Robo\ResultData; |
|
5 |
|
|
6 |
trait StateAwareTrait
|
|
7 |
{ |
|
8 |
protected $state; |
|
9 |
|
|
10 |
/**
|
|
11 |
* {@inheritdoc} |
|
12 |
*/ |
|
13 |
public function getState() |
|
|
{ |
280✔ |
|
return $this->state; |
280✔ |
16 |
} |
|
17 |
|
|
18 |
/**
|
|
19 |
* {@inheritdoc} |
|
20 |
*/ |
|
21 |
public function setState(ResultData $state) |
|
|
{ |
235✔ |
|
$this->state = $state; |
235✔ |
|
} |
235✔ |
25 |
|
|
26 |
/**
|
|
27 |
* {@inheritdoc} |
|
28 |
*/ |
|
29 |
public function setStateValue($key, $value) |
|
|
{ |
× |
|
$this->state[$key] = $value; |
× |
|
} |
× |
33 |
|
|
34 |
/**
|
|
35 |
* {@inheritdoc} |
|
36 |
*/ |
|
37 |
public function updateState(ResultData $update) |
|
|
{ |
135✔ |
|
$this->state->update($update); |
135✔ |
|
} |
135✔ |
41 |
|
|
42 |
/**
|
|
43 |
* {@inheritdoc} |
|
44 |
*/ |
|
45 |
public function resetState() |
|
|
{ |
420✔ |
|
$this->state = new ResultData(); |
420✔ |
|
} |
420✔ |
49 |
} |