MobileDetect   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 20
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 4 1
1
<?php
2
3
namespace MobileDetectModule\Mvc\Controller\Plugin;
4
5
use Detection\MobileDetect as MobileDetector;
6
use Zend\Mvc\Controller\Plugin\AbstractPlugin;
7
8
/**
9
 * @author Nikola Posa <[email protected]>
10
 */
11
final class MobileDetect extends AbstractPlugin
12
{
13
    /**
14
     * @var MobileDetector
15
     */
16
    private $mobileDetect;
17
    
18 2
    public function __construct(MobileDetector $mobileDetect)
19
    {
20 2
        $this->mobileDetect = $mobileDetect;
21 2
    }
22
23
    /**
24
     * @return MobileDetector
25
     */
26 1
    public function __invoke()
27
    {
28 1
        return $this->mobileDetect;
29
    }
30
}
31