Completed
Push — master ( 1f981d...cc2765 )
by Richard
06:42
created

Everything   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 6
Bugs 0 Features 3
Metric Value
wmc 3
c 6
b 0
f 3
lcom 0
cbo 2
dl 0
loc 18
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A meaning() 0 3 1
A compile() 0 6 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