Completed
Push — master ( 389cae...29b40e )
by Richard
06:27
created

ButNot::explain()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 5
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 5
loc 5
ccs 0
cts 4
cp 0
rs 9.4285
nc 1
cc 1
eloc 4
nop 1
crap 2
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 licence along with the code.
9
 */
10
11
namespace Lechimp\Dicto\Variables;
12
13 View Code Duplication
class ButNot extends Variable {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14
    /**
15
     * @var Variable
16
     */
17
    private $left;
18
19
    /**
20
     * @var Variable
21
     */
22
    private $right;
23
24 67
    public function __construct($name, Variable $left, Variable $right) {
25 67
        parent::__construct($name);
26 67
        $this->left = $left;
27 67
        $this->right = $right;
28 67
    }
29
30
    /**
31
     * @return  Variable
32
     */
33 18
    public function left() {
34 18
        return $this->left;
35
    }
36
37
    /**
38
     * @return  Variable
39
     */
40 18
    public function right() {
41 18
        return $this->right;
42
    }
43
44
    /**
45
     * @inheritdoc
46
     */
47
    public function explain($text) {
48
        $v = new ButNot($this->name(), $this->left, $this->right);
49
        $v->setExplanation($text);
50
        return $v;
51
    }
52
}
53