MobileDetector::isMobile()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 3
eloc 5
nc 3
nop 0
1
<?php
2
namespace rtens\domin\delivery\web;
3
4
use Detection\MobileDetect;
5
6
class MobileDetector {
7
8
    /**
9
     * @return bool
10
     */
11
    public function isMobile() {
12
        if (class_exists(MobileDetect::class)) {
13
            $detect = new MobileDetect();
14
            return $detect->isMobile() || $detect->isTablet();
15
        }
16
        return true;
17
    }
18
19
}