Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
21 | 6 | public function play(PlayerId $playerId, Move $move) |
|
22 | { |
||
23 | 6 | $playMethod = 'play' . $this->getClassName($move); |
|
24 | |||
25 | 6 | if (! method_exists($this, $playMethod)) { |
|
26 | 3 | throw new IllegalMoveException($move, 'Error: move was not recognized!'); |
|
27 | } |
||
28 | |||
29 | 3 | return $this->$playMethod($playerId, $move); |
|
30 | } |
||
31 | |||
44 |