Completed
Push — master ( 608de6...159902 )
by Richard
05:43
created

Everything::compile()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
cc 2
eloc 4
nc 1
nop 3
crap 2
1
<?php
2
/******************************************************************************
3
 * An implementation of dicto (scg.unibe.ch/dicto) in and for PHP.
4
 * 
5
 * Copyright (c) 2016 Richard Klees <[email protected]>
6
 *
7
 * This software is licensed under The MIT License. You should have received 
8
 * a copy of the licence along with the code.
9
 */
10
11
namespace Lechimp\Dicto\Variables;
12
13
use Doctrine\DBAL\Query\Expression\ExpressionBuilder;
14
15
class Everything extends Variable {
16
    /**
17
     * @inheritdocs
18
     */
19 23
    public function compile(ExpressionBuilder $builder, $table_name, $negate = false) {
20 23
        return $builder->eq 
21 23
            ( $builder->literal($negate ? 0 : 1)
22 23
            , $builder->literal(1)
23 23
            );
24
    }
25
}
26
27