Issues (2)

src/AutosizeAsset.php (2 issues)

1
<?php
2
3
/*
4
 * Yii2 asset for bower autosize
5
 *
6
 * @link      https://github.com/hiqdev/yii2-asset-autosize
7
 * @package   yii2-asset-autosize
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hiqdev\assets\autosize;
13
14
class AutosizeAsset extends \yii\web\AssetBundle
15
{
16
    public $sourcePath = '@bower/autosize';
17
18
    public $js = [
19
        'dist/autosize.min.js',
20
    ];
21
22
    /**
23
     * @param View $view
0 ignored issues
show
The type hiqdev\assets\autosize\View was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
24
     * @param string $inputSelector
25
     * @return static
26
     */
27
    public static function activate($view, string $inputSelector = '.autosize'): AutosizeAsset
28
    {
29
        $bundle = self::register($view);
30
        $view->registerJs("(function() { setTimeout(function() { autosize($('{$inputSelector}')) }, 200); })();");
31
32
        return $bundle;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $bundle returns the type yii\web\AssetBundle which includes types incompatible with the type-hinted return hiqdev\assets\autosize\AutosizeAsset.
Loading history...
33
    }
34
}
35