Passed
Push — main ( 6ff268...46b174 )
by Osvaldo
01:43
created

Orden::alfaNumerico()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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