| Conditions | 2 |
| Paths | 2 |
| Total Lines | 23 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 42 | public static function create($from, $to) |
||
| 43 | { |
||
| 44 | self::checkPoint($from); |
||
| 45 | self::checkPoint($to); |
||
| 46 | |||
| 47 | $lowestDimension = self::getLowestPointsDimension($from, $to); |
||
| 48 | |||
| 49 | $argsToClass = array( |
||
| 50 | 'AbstractLine', |
||
| 51 | 'Line1D', |
||
| 52 | 'Line2D', |
||
| 53 | 'Line3D', |
||
| 54 | 'Line4D', |
||
| 55 | ); |
||
| 56 | |||
| 57 | if (!isset($argsToClass[$lowestDimension])) { |
||
| 58 | throw new LineException('Unknown dimension'); |
||
| 59 | } |
||
| 60 | |||
| 61 | $className = __NAMESPACE__ . "\\{$argsToClass[$lowestDimension]}"; |
||
| 62 | |||
| 63 | return new $className($from, $to); |
||
| 64 | } |
||
| 65 | } |
||
| 66 |
It seems like you are relying on a variable being defined by an iteration: