InputError   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 16
rs 10
ccs 0
cts 7
cp 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A setFromInputErrorCumulative() 0 8 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