for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Yandex.Metrika counter for Yii2 applications
*
* @link https://github.com/hiqdev/yii2-yandex-metrika
* @package yii2-yandex-metrika
* @license BSD-3-Clause
* @copyright Copyright (c) 2017-2019, HiQDev (http://hiqdev.com/)
*/
namespace hiqdev\yii2\YandexMetrika;
use Yii;
use yii\web\View;
class Behavior extends \yii\base\Behavior
{
public $builder;
public function events()
return [
View::EVENT_END_BODY => 'onEndBody',
];
}
public function onEndBody($event)
$event
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function onEndBody(/** @scrutinizer ignore-unused */ $event)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
echo $this->getBuilder()->render();
public function getBuilder()
if (!is_object($this->builder)) {
$this->builder = Yii::createObject($this->builder);
return $this->builder;
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.