Completed
Push — master ( 95aedb...06e367 )
by Alexey
15:04
created

AssetManager::hash()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
namespace tests;
4
5
/**
6
 * Class AssetManager
7
 * @package tests
8
 */
9
class AssetManager extends \yii\web\AssetManager
10
{
11
    private $_hashes = [];
12
    private $_counter = 0;
13
    /**
14
     * @inheritdoc
15
     */
16
    public function hash($path) {
17
        if (!isset($this->_hashes[$path])) {
18
            $this->_hashes[$path] = $this->_counter++;
19
        }
20
        return $this->_hashes[$path];
21
    }
22
}