Completed
Push — master ( 1f981d...cc2765 )
by Richard
06:42
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 4
Bugs 0 Features 2
Metric Value
c 4
b 0
f 2
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 license 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 28
    public function meaning() {
20 28
        return "everything";
21
    }
22
23
    /**
24
     * @inheritdocs
25
     */
26 23
    public function compile(ExpressionBuilder $builder, $table_name, $negate = false) {
27 23
        return $builder->eq 
28 23
            ( $builder->literal($negate ? 0 : 1)
29 23
            , $builder->literal(1)
30 23
            );
31
    }
32
}
33
34