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

LanguageConstruct::construct_name()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
nc 1
cc 1
eloc 2
nop 0
crap 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 licence along with the code.
9
 */
10
11
namespace Lechimp\Dicto\Variables;
12
13
class LanguageConstruct extends Variable {
14
    /**
15
     * @var string
16
     */
17
    private $construct_name;
18
19 99
    public function __construct($name, $construct_name) {
20 99
        parent::__construct($name);
21 99
        assert('is_string($construct_name)');
22
        // TODO: Restrict the possible construct_names (like @, unset, echo, ...)
0 ignored issues
show
Unused Code Comprehensibility introduced by
36% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
23 99
        $this->construct_name = $construct_name;     
24 99
    }
25
26
    /**
27
     * @inheritdoc
28
     */
29
    public function explain($text) {
30
        $v = new Buildins();
31
        $v->setExplanation($text);
32
        return $v;
33
    }
34
35
    /**
36
     * @return  string
37
     */
38 7
    public function construct_name() {
39 7
        return $this->construct_name;
40
    }
41
}
42
43