Passed
Push — main ( 80bde2...4e6f22 )
by Osvaldo
05:18
created

SentenciaInsert   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 19
ccs 8
cts 8
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A sql() 0 3 1
A datos() 0 3 1
A __construct() 0 4 1
1
<?php
2
namespace src\pdodatabase\sentencias\insert;
3
4
use src\pdodatabase\elementos\{Tabla,Insert};
5
6
class SentenciaInsert
7
{
8
    private $_donde;
9
    private $_insert;
10
    
11 4
    public function __construct(Tabla $Donde, Insert $Insert)
12
    {
13 4
        $this->_donde = $Donde;
14 4
        $this->_insert = $Insert;
15 4
    }
16
17 2
    public function sql(): string
18
    {
19 2
        return 'INSERT INTO '.$this->_donde->sql().' '.$this->_insert->sql();
20
    }
21
22 2
    public function datos(): array
23
    {
24 2
        return $this->_insert->datos();
25
    }
26
}