Completed
Push — master ( 23e282...478907 )
by Revin
02:44
created

AssetBundle   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 8
Bugs 0 Features 0
Metric Value
wmc 1
c 8
b 0
f 0
lcom 1
cbo 1
dl 0
loc 29
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 8 1
1
<?php
2
/**
3
 * AssetBundle.php
4
 * @author Revin Roman
5
 * @link https://rmrevin.ru
6
 */
7
8
namespace rmrevin\yii\fontawesome;
9
10
/**
11
 * Class AssetBundle
12
 * @package rmrevin\yii\fontawesome
13
 */
14
class AssetBundle extends \yii\web\AssetBundle
15
{
16
17
    /**
18
     * @inherit
19
     */
20
    public $sourcePath = '@vendor/rmrevin/yii2-fontawesome/assets';
21
22
    /**
23
     * @inherit
24
     */
25
    public $css = [
26
        'css/font-awesome.min.css',
27
    ];
28
29
    /**
30
     * Initializes the bundle.
31
     * Set publish options to copy only necessary files (in this case css and font folders)
32
     * @codeCoverageIgnore
33
     */
34
    public function init()
35
    {
36
        parent::init();
37
38
        $this->publishOptions['beforeCopy'] = function ($from, $to) {
0 ignored issues
show
Unused Code introduced by
The parameter $to is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
39
            return preg_match('%(/|\\\\)(fonts|css)%', $from);
40
        };
41
    }
42
}