FromComponentTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
addRootTable() 0 1 ?
A from() 0 4 1
A addFrom() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of UnderQuery package.
5
 *
6
 * Copyright (c) 2016 Beniamin Jonatan Šimko
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Phuria\UnderQuery\QueryBuilder\Component;
13
14
use Phuria\UnderQuery\Table\AbstractTable;
15
16
/**
17
 * @author Beniamin Jonatan Šimko <[email protected]>
18
 */
19
trait FromComponentTrait
20
{
21
    /**
22
     * @param mixed       $table
23
     * @param string|null $alias
24
     *
25
     * @return AbstractTable
26
     */
27
    abstract public function addRootTable($table, $alias = null);
28
29
    /**
30
     * @param mixed       $table
31
     * @param string|null $alias
32
     *
33
     * @return AbstractTable
34
     */
35 1
    public function from($table, $alias = null)
36
    {
37 1
        return $this->addFrom($table, $alias);
38
    }
39
40
    /**
41
     * @param mixed       $table
42
     * @param string|null $alias
43
     *
44
     * @return AbstractTable
45
     */
46 1
    public function addFrom($table, $alias = null)
47
    {
48 1
        return $this->addRootTable($table, $alias);
49
    }
50
}