Completed
Push — master ( 00502f...bef3d5 )
by Steve
03:34
created

TotallyLegit::name()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace MeadSteve\DiceApi\DiceDecorators;
4
5
use MeadSteve\DiceApi\Dice;
6
7
class TotallyLegit implements Dice
8
{
9
    private $dice;
10
    private $alwaysRoll;
11
12
    public function __construct(Dice $dice, $alwaysRoll = 6)
13
    {
14
        $this->dice = $dice;
15
        $this->alwaysRoll = (int) $alwaysRoll;
16
    }
17
    public function name()
18
    {
19
        return $this->dice->name();
20
    }
21
22
    public function roll()
23
    {
24
        return $this->alwaysRoll;
25
    }
26
}
27