Issues (5)

src/View/Helper/AssetHelper.php (1 issue)

1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * BEdita, API-first content management framework
6
 * Copyright 2019 ChannelWeb Srl, Chialab Srl
7
 *
8
 * This file is part of BEdita: you can redistribute it and/or modify
9
 * it under the terms of the GNU Lesser General Public License as published
10
 * by the Free Software Foundation, either version 3 of the License, or
11
 * (at your option) any later version.
12
 *
13
 * See LICENSE.LGPL or <http://gnu.org/licenses/lgpl-3.0.html> for more details.
14
 */
15
16
namespace BEdita\WebTools\View\Helper;
17
18
use BEdita\WebTools\Utility\AssetsRevisions;
19
use Cake\View\Helper;
20
21
/**
22
 * Asset Helper to handle asset names with signatures.
23
 *
24
 * @see AssetsRevisions for details
25
 */
26
class AssetHelper extends Helper
27
{
28
    /**
29
     * Retrieve `revved` asset name if found in manifest or return canonical asset name otherwise
30
     *
31
     * @param string $name Canonical asset name (un-revved)
32
     * @return string
33
     * @deprecated Deprecated since 1.3.0 Use `AssetsRevisions::get` or `Html` helper methods `script` or `css` directly.
34
     */
35
    public function get(string $name): string
36
    {
37
        return AssetsRevisions::get($name);
0 ignored issues
show
Bug Best Practice introduced by
The expression return BEdita\WebTools\U...tsRevisions::get($name) could return the type array which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
38
    }
39
}
40