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

Except::id()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 1
b 0
f 1
cc 1
eloc 2
nc 1
nop 0
crap 1
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