| Conditions | 4 |
| Paths | 6 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public static function guess($waypoint) |
||
| 38 | { |
||
| 39 | $waypointType = null; |
||
| 40 | |||
| 41 | if (stripos($waypoint, self::OC) === 0) { |
||
| 42 | $waypointType = self::OC; |
||
| 43 | } elseif (stripos($waypoint, self::GC) === 0) { |
||
| 44 | $waypointType = self::GC; |
||
| 45 | } |
||
| 46 | |||
| 47 | if ($waypointType === null) { |
||
| 48 | throw new UnknownWaypointTypeException( |
||
| 49 | sprintf( |
||
| 50 | 'Could not guess the waypoint type of the waypoint "%s"', |
||
| 51 | $waypoint |
||
| 52 | ) |
||
| 53 | ); |
||
| 54 | } |
||
| 55 | |||
| 56 | return $waypointType; |
||
| 57 | } |
||
| 58 | } |
||
| 59 |