Conditions | 4 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
32 | 9 | public function extractMessage($object) |
|
33 | { |
||
34 | 9 | if (!$object instanceof GameResult) { |
|
35 | 3 | return null; |
|
36 | } |
||
37 | |||
38 | 6 | foreach ($this->gameResultExtractors as $extractor) { |
|
39 | 6 | if ($message = $extractor->extractMessage($object)) { |
|
40 | 4 | return $message; |
|
41 | } |
||
42 | 2 | } |
|
43 | |||
44 | 3 | throw new \InvalidArgumentException('Unsupported Game Result'); |
|
45 | } |
||
46 | } |
||
47 |