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

ShipmentAdapterCollection::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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