travis-ci
84 of 84 new or added lines in 5 files covered. (100.0%)
3254 of 5416 relevant lines covered (60.08%)
34.43 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() |
|
|
{ |
170✔ |
|
return $this->state; |
170✔ |
16 |
} |
|
17 |
|
|
18 |
/**
|
|
19 |
* {@inheritdoc} |
|
20 |
*/ |
|
21 |
public function setState(ResultData $state) |
|
|
{ |
115✔ |
|
$this->state = $state; |
115✔ |
|
} |
115✔ |
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 |
} |