Completed
Push — master ( abe4a2...2abbc3 )
by Sam
05:40
created

InputError::setFromInputErrorCumulative()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
eloc 6
nc 1
nop 1
1
<?php
2
3
namespace Jalle19\StatusManager\Database;
4
5
use Jalle19\StatusManager\Database\Base\InputError as BaseInputError;
6
use Jalle19\StatusManager\Instance\InputErrorCumulative;
7
8
/**
9
 * Class InputError
10
 * @package   Jalle19\StatusManager\Database
11
 * @copyright Copyright &copy; Sam Stenvall 2016-
12
 * @license   https://www.gnu.org/licenses/gpl.html The GNU General Public License v2.0
13
 */
14
class InputError extends BaseInputError
15
{
16
17
	/**
18
	 * @param InputErrorCumulative $cumulative
19
	 *
20
	 * @return InputError
21
	 */
22
	public function setFromInputErrorCumulative(InputErrorCumulative $cumulative)
23
	{
24
		$this->setBerAverage($cumulative->getAverageValue(InputErrorCumulative::VALUE_TYPE_BER));
25
		$this->setUncAverage($cumulative->getAverageValue(InputErrorCumulative::VALUE_TYPE_UNC));
26
		$this->setCumulativeTe($cumulative->getLastValue(InputErrorCumulative::VALUE_TYPE_TE));
27
		$this->setCumulativeCc($cumulative->getLastValue(InputErrorCumulative::VALUE_TYPE_CC));
28
29
		return $this;
30
	}
31
32
}
33