Passed
Push — master ( 0290f6...6a95f6 )
by Robert
04:21
created

SDEs   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 15
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

2 Methods

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