Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
100.00%
1 / 1
100.00%
1 / 1
CRAP
100.00%
3 / 3
MobileDetectHelper
100.00%
1 / 1
100.00%
1 / 1
2
100.00%
3 / 3
 __invoke()
100.00%
1 / 1
2
100.00%
3 / 3
<?php
namespace Neilime\MobileDetect\Mvc\Controller\Plugin;
class MobileDetectHelper extends \Zend\Mvc\Controller\Plugin\AbstractPlugin{
/**
* Retrieve Mobile-detect service
* @throws \LogicException
* @return \Mobile_Detect
*/
public function __invoke(){
$oController = $this->getController();
if($oController)return $this->getController()->getServiceLocator()->get('MobileDetect');
throw new \LogicException('Controller is udefined for MobileDetectHelper');
}