Completed
Push — master ( cc2765...340ff8 )
by Richard
08:19
created

Except   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 88.89%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 18
ccs 8
cts 9
cp 0.8889
rs 10
c 1
b 0
f 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A id() 0 3 1
A compile() 0 9 2
1
<?php
2
/******************************************************************************
3
 * An implementation of dicto (scg.unibe.ch/dicto) in and for PHP.
4
 * 
5
 * Copyright (c) 2016, 2015 Richard Klees <[email protected]>
6
 *
7
 * This software is licensed under The MIT License. You should have received 
8
 * a copy of the license along with the code.
9
 */
10
11
namespace Lechimp\Dicto\Variables;
12
13
use Doctrine\DBAL\Query\Expression\ExpressionBuilder;
14
15
class Except extends Combinator {
16
    /**
17
     * @inheritdocs
18
     */
19 49
    public function id() {
20 49
        return "except";
21
    }
22
23 18
    public function compile(ExpressionBuilder $builder, $table_name, $negate = false) {
24 18
        if ($negate) {
25
            throw \LogicException("NYI!");
26
        }
27 18
        return $builder->andX
28 18
            ( $this->left()->compile($builder, $table_name)
29 18
            , $this->right()->compile($builder, $table_name, true)
30 18
            );
31
    }
32
}
33