Test Setup Failed
Push — 2.x ( 2ebb38 )
by Revin
41s
created

AssetBundle.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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/fortawesome/font-awesome';
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
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
}
43