Passed
Push — main ( 088d44...a78334 )
by Osvaldo
01:57
created

Columna::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
namespace src\pdodatabase\elementos;
3
4
use Exception;
5
use src\interfaces\UnidadDeValorInterface;
6
7
class Columna implements UnidadDeValorInterface
8
{
9
    private $_columna;
10
11
    public function __construct(string $columna)
12
    {
13
        $this->columnaVacia($columna);
14
        $this->_columna = $columna;
15
    }
16
17
    public function valor(): string
18
    {
19
        return $this->_columna;
20
    }
21
22
    private function columnaVacia(string $columna)
23
    {
24
        if(empty($columna))
25
        {
26
            throw new Exception("columna vacia"); 
27
        }
28
    }
29
}