TestTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 16 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Widgets\Tests\Support;
6
7
use Yiisoft\Aliases\Aliases;
8
use Yiisoft\Cache\Cache;
9
use Yiisoft\Cache\CacheInterface;
10
use Yiisoft\Test\Support\Container\SimpleContainer;
11
use Yiisoft\Test\Support\EventDispatcher\SimpleEventDispatcher;
12
use Yiisoft\Test\Support\SimpleCache\MemorySimpleCache;
13
use Yiisoft\View\WebView;
14
use Yiisoft\Widget\WidgetFactory;
15
16
trait TestTrait
17
{
18
    private CacheInterface $cache;
19
    private WebView $webView;
20
21
    protected function setUp(): void
22
    {
23
        parent::setUp();
24
25
        $container = new SimpleContainer(
26
            [
27
                Aliases::class => new Aliases(['@public' => __DIR__]),
28
                CacheInterface::class => new Cache(new MemorySimpleCache()),
29
                WebView::class => new WebView(__DIR__ . '/public/view', new SimpleEventDispatcher()),
30
            ]
31
        );
32
33
        WidgetFactory::initialize($container, []);
34
35
        $this->cache = $container->get(CacheInterface::class);
36
        $this->webView = $container->get(WebView::class);
37
    }
38
}
39
40
namespace Yiisoft\Html;
41
42
function hrtime(bool $getAsNumber = false): void
0 ignored issues
show
Unused Code introduced by
The parameter $getAsNumber is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

42
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.

Loading history...
43
{
44
}
45