for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Created for IG Monitoring.
* User: jakim <[email protected]>
* Date: 11.01.2018
*/
namespace app\components\http;
use yii\base\Component;
use yii\caching\Cache;
use yii\di\Instance;
class UserAgent extends Component
{
public $cache = 'cache';
* @return mixed
* @throws \yii\base\InvalidConfigException
public function random()
/** @var \yii\caching\Cache $cache */
$cache = Instance::ensure($this->cache);
$items = $cache->getOrSet(__METHOD__, function(Cache $cache) {
$cache
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
$items = $cache->getOrSet(__METHOD__, function(/** @scrutinizer ignore-unused */ Cache $cache) {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return (new \jakim\ua\UserAgent())->fetch();
}, 60 * 60 * 24 * 30);
shuffle($items);
return $items['0'];
}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.