| Conditions | 3 |
| Paths | 14 |
| Total Lines | 21 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 17 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 10 | public function __construct(Timer $timer) |
|
| 24 | { |
||
| 25 | 10 | $this->name = $timer->getName(); |
|
| 26 | 10 | $this->creation = $timer->getCreation(); |
|
| 27 | try { |
||
| 28 | 10 | $count = $timer->getCount(); |
|
| 29 | 10 | $this->previous = $timer->getPrevious(); |
|
| 30 | 9 | $this->start = $timer->getStart(); |
|
| 31 | 9 | $this->elapsed = $timer->getElapsed(); |
|
| 32 | 9 | $this->stopped = $timer->isStopped(); |
|
| 33 | 9 | $this->currentValue = $timer->getLastValue(); |
|
| 34 | 9 | $this->minValueIteration = $timer->getMinValueIteration(); |
|
| 35 | 9 | $this->maxValueIteration = $timer->getMaxValueIteration(); |
|
| 36 | 9 | $this->avgValue = $timer->getAverageValue(); |
|
| 37 | 9 | $this->minValue = ($count === 1) ? $timer->getLastValue() : $timer->getMinValue(); |
|
| 38 | 9 | $this->maxValue = $timer->getMaxValue(); |
|
| 39 | 9 | $this->count = $count; |
|
| 40 | 2 | } catch (\Throwable $e) { |
|
| 41 | // no further action |
||
| 42 | } |
||
| 43 | 10 | parent::__construct(); |
|
| 44 | 10 | } |
|
| 46 |