| Conditions | 4 | 
| Paths | 4 | 
| Total Lines | 18 | 
| Code Lines | 10 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 6 | 
| CRAP Score | 5.5021 | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php | ||
| 14 | 9 | public function getTypeOf($value) | |
| 15 |     { | ||
| 16 | 9 |         foreach ($this->getPossibleTypes() as $type) { | |
| 17 | 9 |             if ($isTypeOf = $type->isTypeOf($value)) { | |
| 18 | 9 | return $type; | |
| 19 | } | ||
| 20 | |||
| 21 | 9 |             if (!isset($isTypeOf)) { | |
| 22 | throw new \Exception(sprintf( | ||
| 23 | 'Non-Object Type %s does not implement resolveType and Object ' . | ||
| 24 | 'Type %s does not implement isTypeOf. There is no way to ' . | ||
| 25 | 'determine if a value is of this type.', $this->getName(), $type->getName() | ||
| 26 | )); | ||
| 27 | } | ||
| 28 | 9 | } | |
| 29 | |||
| 30 | return NULL; | ||
| 31 | } | ||
| 32 | } | ||
| 33 |