Passed
Push — master ( b19e1a...9e97df )
by Robert
03:55
created

ConsumerParticipants   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 12
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
1
<?php
2
3
namespace LivePersonInc\LiveEngageLaravel\Collections;
4
5
use Illuminate\Support\Collection;
6
use LivePersonInc\LiveEngageLaravel\Models\Visitor;
7
use LivePersonInc\LiveEngageLaravel\Models\MetaData;
8
9
class ConsumerParticipants extends Collection
10
{
11
	public $metaData;
12
	
13 1
	public function __construct(array $models = [])
14
	{
15
		
16
		$models = array_map(function($item) {
17 1
			return is_a($item, 'LivePersonInc\LiveEngageLaravel\Models\Visitor') ? $item : new Visitor((array) $item);
18 1
		}, $models);
19 1
		$this->metaData = new MetaData();
20 1
		parent::__construct($models);
21 1
	}
22
}
23