Collection   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 5
Bugs 0 Features 1
Metric Value
wmc 1
c 5
b 0
f 1
lcom 0
cbo 2
dl 0
loc 15
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromArray() 0 4 1
1
<?php
2
3
namespace Sl\Collections;
4
5
use Sl\Contracts\MapperInterface;
6
use Illuminate\Support\Collection as BaseCollection;
7
use Sl\Contracts\Collections\CollectionInterface;
8
9
class Collection extends BaseCollection implements CollectionInterface
10
{
11
    /**
12
     * Create from raw array data.
13
     *
14
     * @param array                         $items
15
     * @param \Sl\Contracts\MapperInterface $mapper
16
     *
17
     * @return \Sl\Contracts\Collections\CollectionInterface
18
     */
19 11
    public static function fromArray(array $items, MapperInterface $mapper)
20
    {
21 11
        return new static($mapper->map($items));
22
    }
23
}
24