ColumnsMetadata   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getColumn() 0 8 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Soluble\Metadata;
6
7
use ArrayObject;
8
use Soluble\Datatype\Column\Definition\AbstractColumnDefinition;
9
10
class ColumnsMetadata extends ArrayObject
11
{
12
    /**
13
     * Return specific column metadata.
14
     *
15
     * @throws Exception\UnexistentColumnException
16
     */
17 2
    public function getColumn(string $name): AbstractColumnDefinition
18
    {
19 2
        if (!$this->offsetExists($name)) {
20 2
            throw new Exception\UnexistentColumnException("Column '$name' does not exists in metadata");
21
        }
22
23 2
        return $this->offsetGet($name);
24
    }
25
}
26