Passed
Push — main ( f2df15...8d7bb5 )
by Osvaldo
09:13
created

Tabla::tabla()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
namespace src\pdodatabase\elementos;
3
4
use Exception;
5
6
class Tabla
7
{
8
    private $_tabla;
9
10
    public function __construct(string $tabla)
11
    {
12
        $this->_tabla = $this->setTabla($tabla);
13
    }
14
15
    public function tabla(): string
16
    {
17
        return $this->_tabla;
18
    }
19
20
    private function setTabla(string $tabla): string
21
    {
22
        if(empty($tabla))
23
        {
24
            throw new Exception("La tabla no puede estar vacia");
25
        }
26
27
        return ' '.$tabla;
28
    }
29
}