Test Failed
Push — master ( 3b4c09...efb6fb )
by Richard
02:50
created

Property   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 45
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A left() 0 3 1
A id() 0 3 1
A parameters() 0 3 1
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 license along with the code.
9
 */
10
11
namespace Lechimp\Dicto\Definition\AST;
12
13
/**
14
 * A property of some variable.
15
 */
16
class Property extends Definition {
17
    /**
18
     * @var Definition 
19
     */
20
    protected $left;
21
22
    /**
23
     * @var Atom
24
     */
25
    protected $id;
26
27
    /**
28
     * @var Parameter[]
29
     */
30
    protected $parameters;
31
32
    public function __construct(Definition $left, Atom $id, array $parameters) {
33
        $this->left = $left;
34
        $this->id = $id;
35
        $this->parameters = array_map(function(Parameter $p) {
36
            return $p;
37
        }, $parameters);
38
    }
39
40
    /**
41
     * @return  Definition 
42
     */
43
    public function left() {
44
        return $this->left;
45
    }
46
47
    /**
48
     * @return  Atom 
49
     */
50
    public function id() {
51
        return $this->id;
52
    }
53
54
    /**
55
     * @return  Parameter[] 
56
     */
57
    public function parameters() {
58
        return $this->parameters;
59
    }
60
}
61
62