State   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 5
c 1
b 0
f 0
dl 0
loc 36
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A brake() 0 3 1
A speedUp() 0 3 1
A turnOn() 0 3 1
A turnOff() 0 3 1
1
<?php
2
3
namespace Tleckie\DesignPatterns\State;
4
5
use Exception;
6
7
/**
8
 * Class State
9
 *
10
 * @package Tleckie\DesignPatterns\State
11
 * @author  Teodoro Leckie Westberg <[email protected]>
12
 */
13
class State implements CarState
14
{
15
    /**
16
     * @return SpeedUpState
17
     * @throws Exception
18
     */
19
    public function speedUp(): SpeedUpState
20
    {
21
        throw new Exception();
22
    }
23
24
    /**
25
     * @return BrakeState
26
     * @throws Exception
27
     */
28
    public function brake(): BrakeState
29
    {
30
        throw new Exception();
31
    }
32
33
    /**
34
     * @return OffState
35
     * @throws Exception
36
     */
37
    public function turnOff(): OffState
38
    {
39
        throw new Exception();
40
    }
41
42
    /**
43
     * @return OnState
44
     * @throws Exception
45
     */
46
    public function turnOn(): OnState
47
    {
48
        throw new Exception();
49
    }
50
}
51