Completed
Push — master ( 6e4599...c950aa )
by Sergei
29s queued 14s
created

Join   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 12
c 1
b 0
f 0
dl 0
loc 35
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A left() 0 3 1
A __construct() 0 6 1
A right() 0 3 1
A inner() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\DBAL\Query;
6
7
/**
8
 * @internal
9
 */
10
final class Join
11
{
12
    /** @var string */
13
    public $type;
14
15
    /** @var string */
16
    public $table;
17
18
    /** @var string */
19
    public $alias;
20
21
    /** @var string|null */
22
    public $condition;
23
24
    private function __construct(string $type, string $table, string $alias, ?string $condition)
25
    {
26
        $this->type      = $type;
27
        $this->table     = $table;
28
        $this->alias     = $alias;
29
        $this->condition = $condition;
30
    }
31
32
    public static function inner(string $table, string $alias, ?string $condition) : Join
33
    {
34
        return new self('INNER', $table, $alias, $condition);
35
    }
36
37
    public static function left(string $table, string $alias, ?string $condition) : Join
38
    {
39
        return new self('LEFT', $table, $alias, $condition);
40
    }
41
42
    public static function right(string $table, string $alias, ?string $condition) : Join
43
    {
44
        return new self('RIGHT', $table, $alias, $condition);
45
    }
46
}
47