Passed
Push — master ( afdec1...60a2b8 )
by Chris
07:28
created

StandardMap   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A insert() 0 9 2
1
<?php
2
3
namespace WebTheory\Collection\Driver;
4
5
use WebTheory\Collection\Contracts\ArrayDriverInterface;
6
use WebTheory\Collection\Driver\Abstracts\AbstractArrayDriver;
7
8
class StandardMap extends AbstractArrayDriver implements ArrayDriverInterface
9
{
10
    public function insert(array &$array, object $item, $locator = null): bool
11
    {
12
        if ($this->arrayContainsObject($array, $item)) {
13
            return false;
14
        }
15
16
        $array[$locator] = $item;
17
18
        return true;
19
    }
20
}
21