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