| Conditions | 5 |
| Paths | 5 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5.025 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | 7 | public static function getValue(Agent $agent): ?int |
|
| 30 | { |
||
| 31 | 7 | if ($agent->isDesktop()) { |
|
| 32 | 7 | return DeviceType::DESKTOP; |
|
| 33 | 1 | } else if ($agent->isTablet()) { |
|
| 34 | 1 | return DeviceType::TABLET; |
|
| 35 | 1 | } else if ($agent->isPhone()) { |
|
| 36 | 1 | return DeviceType::PHONE; |
|
| 37 | 1 | } elseif ($agent->isRobot()) { |
|
| 38 | 1 | return DeviceType::ROBOT; |
|
| 39 | } |
||
| 40 | |||
| 41 | return null; |
||
| 42 | } |
||
| 44 |