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