Test Failed
Pull Request — master (#133)
by Rustam
03:14
created

AssetLoaderInterfaceProxy::getAssetUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Debug\Collector;
6
7
use Yiisoft\Assets\AssetBundle;
8
use Yiisoft\Assets\AssetLoaderInterface;
9
10
final class AssetLoaderInterfaceProxy implements AssetLoaderInterface
11
{
12
    public function __construct(
13
        private AssetLoaderInterface $assetLoader,
14
        private AssetCollector $assetCollector
15
    ) {
16
    }
17
18
    public function getAssetUrl(AssetBundle $bundle, string $assetPath): string
19
    {
20
        return $this->assetLoader->getAssetUrl($bundle, $assetPath);
21
    }
22
23
    public function loadBundle(string $name, array $config = []): AssetBundle
24
    {
25
        $bundle = $this->assetLoader->loadBundle($name, $config);
26
27
        $this->assetCollector->collect($bundle);
28
        return $bundle;
29
    }
30
}
31