Completed
Push — master ( 0fb6c2...a0d538 )
by Adam
19:02
created

ShipmentAdapterCollection   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 12
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 4 1
A get() 0 4 1
1
<?php
2
3
namespace WellCommerce\Bundle\ShipmentBundle\Processor;
4
5
use WellCommerce\Bundle\ShipmentBundle\Adapter\ShipmentAdapterInterface;
6
use WellCommerce\Component\Collections\ArrayCollection;
7
8
/**
9
 * Class ShipmentAdapterCollection
10
 *
11
 * @author  Adam Piotrowski <[email protected]>
12
 */
13
class ShipmentAdapterCollection extends ArrayCollection
14
{
15
    public function add(ShipmentAdapterInterface $adapter)
16
    {
17
        $this->items[$adapter->getAlias()] = $adapter;
18
    }
19
    
20
    public function get($key): ShipmentAdapterInterface
21
    {
22
        return $this->items[$key];
23
    }
24
}
25