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

SDEs::getSDE()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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