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

Relation::target()   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 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
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 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