InputError::setFromInputErrorCumulative()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 8
rs 10
ccs 0
cts 7
cp 0
crap 2
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