Engagement   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 1
eloc 13
c 2
b 1
f 0
dl 0
loc 21
ccs 9
cts 9
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 17 1
1
<?php
2
/**
3
 * Engagement
4
 *
5
 * @package LivePersonInc\LiveEngageLaravel\Models
6
 */
7
8
namespace LivePersonInc\LiveEngageLaravel\Models;
9
10
use Illuminate\Database\Eloquent\Model;
11
use LivePersonInc\LiveEngageLaravel\Collections\Transcript;
12
13
class Engagement extends Model
14
{
15
	protected $guarded = [];
16
	
17 2
	public function __construct(array $item)
18
	{
19
		$init = [
20 2
			'info'			=> [],
21
			'visitorInfo'	=> [],
22
			'campaign'		=> [],
23 2
			'transcript'	=> new Transcript([]),
24
		];
25
		
26 2
		$item = array_merge($init, $item);
27
		
28 2
		$item['info'] = new Info((array) $item['info']);
29 2
		$item['visitorInfo'] = new Visitor((array) $item['visitorInfo']);
30 2
		$item['campaign'] = new Campaign((array) $item['campaign']);
31 2
		$item['transcript'] = new Transcript($item['transcript']->lines);
32
33 2
		parent::__construct($item);
34 2
	}
35
}
36