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