Passed
Push — master ( 074c96...5e6d2b )
by Robert
04:56
created

Skills::toSkillIds()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace LivePersonInc\LiveEngageLaravel\Collections;
4
5
use Illuminate\Support\Collection;
6
use LivePersonInc\LiveEngageLaravel\Models\Skill;
7
8
class Skills extends Collection
9
{
10 1
	public function __construct(array $models = [])
11
	{
12
		
13
		$models = array_map(function($item) {
14 1
			return new Skill((array) $item);
15 1
		}, $models);
16
		
17 1
		parent::__construct($models);
18 1
	}
19
	
20 1
	public function toSkillIds()
21
	{
22
		$array = array_map(function($item) {
23 1
			return $item['id'];
24 1
		}, $this->toArray());
25 1
		return $array;
26
	}
27
}