| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | private static function getDimensionNumber($point) |
||
| 16 | { |
||
| 17 | $pointDimensions = array(AbstractPoint::class, Point1D::class, Point2D::class, Point3D::class, Point4D::class); |
||
| 18 | |||
| 19 | foreach ($pointDimensions as $dimension => $pointDimension) |
||
| 20 | { |
||
| 21 | if (!($point instanceof $pointDimension)) { |
||
| 22 | return --$dimension; |
||
| 23 | } |
||
| 24 | } |
||
| 25 | |||
| 26 | return $dimension; |
||
|
|
|||
| 27 | } |
||
| 28 | |||
| 66 |
It seems like you are relying on a variable being defined by an iteration: