Passed
Branch development (0290f6)
by Robert
06:05
created

Transfers   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 55.56%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 18
ccs 5
cts 9
cp 0.5556
rs 10
c 0
b 0
f 0

2 Methods

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