for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Yiisoft\Yii\Widgets\Tests\Support;
use Yiisoft\Aliases\Aliases;
use Yiisoft\Cache\Cache;
use Yiisoft\Cache\CacheInterface;
use Yiisoft\Test\Support\Container\SimpleContainer;
use Yiisoft\Test\Support\EventDispatcher\SimpleEventDispatcher;
use Yiisoft\Test\Support\SimpleCache\MemorySimpleCache;
use Yiisoft\View\WebView;
use Yiisoft\Widget\WidgetFactory;
trait TestTrait
{
private CacheInterface $cache;
private WebView $webView;
protected function setUp(): void
parent::setUp();
$container = new SimpleContainer(
[
Aliases::class => new Aliases(['@public' => __DIR__]),
CacheInterface::class => new Cache(new MemorySimpleCache()),
WebView::class => new WebView(__DIR__ . '/public/view', new SimpleEventDispatcher()),
]
);
WidgetFactory::initialize($container, []);
$this->cache = $container->get(CacheInterface::class);
$this->webView = $container->get(WebView::class);
}
namespace Yiisoft\Html;
function hrtime(bool $getAsNumber = false): void
$getAsNumber
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
function hrtime(/** @scrutinizer ignore-unused */ bool $getAsNumber = false): void
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.