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

LanguageConstruct   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 63.64%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 29
ccs 7
cts 11
cp 0.6364
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A explain() 0 5 1
A construct_name() 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 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