CollectionConstructorTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
set() 0 1 ?
A __construct() 0 6 2
1
<?php
2
3
namespace Nayjest\Collection;
4
5
/**
6
 * Basic collection constructor implementation.
7
 */
8
trait CollectionConstructorTrait
9
{
10
    abstract public function set($items);
11
12
    /**
13
     * Constructor.
14
     *
15
     * @param array|null $items collection items
16
     */
17 32
    public function __construct(array $items = null)
18
    {
19 32
        if ($items !== null) {
20 32
            $this->set($items);
21 32
        }
22 32
    }
23
}
24