Completed
Push — master ( 1e9ef5...3740bc )
by Richard
05:53 queued 29s
created

_True   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A compile() 0 3 1
A for_types() 0 3 1
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\Graph\Predicate;
12
13
use Lechimp\Dicto\Graph\Predicate;
14
use Lechimp\Dicto\Graph\Entity;
15
16
/**
17
 * A predicate that is always true.
18
 */
19
class _True extends Predicate {
20
    /**
21
     * @inheritdocs
22
     */
23
    public function compile() {
24
        return function(Entity $e) { return true; };
0 ignored issues
show
Unused Code introduced by
The parameter $e is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
25
    }
26
27
    /**
28
     * @inheritdocs
29
     */
30 10
    public function for_types($existing_types) {
31 10
        return $existing_types;
32
    }
33
}
34