Test Failed
Push — master ( 492ea4...9c8472 )
by Bingo
04:47
created

DefaultWeightedEdge::getWeight()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Graphp\Edge;
4
5
use Graphp\GraphInterface;
6
use Graphp\Vertex\VertexInterface;
7
8
/**
9
 * Class DefaultWeightedEdge
10
 *
11
 * @package Graphp\Edge
12
 */
13
class DefaultWeightedEdge extends DefaultEdge
14
{
15
    /**
16
     * Weight of the edge
17
     *
18
     * @var float
19
     */
20
    protected $weight = GraphInterface::DEFAULT_EDGE_WEIGHT;
21
22
    /**
23
     * Get weight of the edge
24
     *
25
     * @return null|float
26
     */
27 2
    public function getWeight(): ?float
28
    {
29 2
        return $this->weight;
30
    }
31
32
    /**
33
     * Set the weight of the edge
34
     *
35
     * @param float $weight - the edge weight
36
     */
37 3
    public function setWeight(?float $weight = null): void
38
    {
39 3
        $this->weight = $weight;
40 3
    }
41
}
42