Completed
Push — master ( f7852e...e666ea )
by Richard
06:08
created

Relation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 25
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A target() 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;
12
13
/**
14
 * A relation between two nodes in the Graph. It is unidirectional.
15
 */
16
class Relation extends Entity {
17
    /**
18
     * @var Node
19
     */
20
    private $target;
21
22
    /**
23
     * @param   string              $type
24
     * @param   array<string,mixed> $properties
25
     * @param   Node                $target 
26
     */
27 62
    public function __construct($type, array $properties, Node $target) {
28 62
        parent::__construct($type, $properties);
29 62
        $this->target = $target;
30 62
    }
31
32
    /**
33
     * The target of the relation.
34
     *
35
     * @return  Node
36
     */
37 35
    public function target() {
38 35
        return $this->target;
39
    }
40
}
41