1 | <?php |
||||||
2 | /** |
||||||
3 | * Transcoder plugin for Craft CMS 3.x |
||||||
4 | * |
||||||
5 | * Transcode videos to various formats, and provide thumbnails of the video |
||||||
6 | * |
||||||
7 | * @link https://nystudio107.com |
||||||
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||||||
8 | * @copyright Copyright (c) 2017 nystudio107 |
||||||
0 ignored issues
–
show
|
|||||||
9 | */ |
||||||
0 ignored issues
–
show
|
|||||||
10 | |||||||
11 | namespace nystudio107\transcoder\controllers; |
||||||
12 | |||||||
13 | use Craft; |
||||||
14 | use craft\web\Controller; |
||||||
15 | |||||||
16 | use yii\web\Response; |
||||||
17 | |||||||
18 | /** |
||||||
0 ignored issues
–
show
|
|||||||
19 | * @author nystudio107 |
||||||
0 ignored issues
–
show
Content of the @author tag must be in the form "Display Name <[email protected]>"
Loading history...
|
|||||||
20 | * @package Transcode |
||||||
0 ignored issues
–
show
|
|||||||
21 | * @since 1.0.0 |
||||||
0 ignored issues
–
show
|
|||||||
22 | */ |
||||||
0 ignored issues
–
show
|
|||||||
23 | class ManifestController extends Controller |
||||||
24 | { |
||||||
25 | // Constants |
||||||
26 | // ========================================================================= |
||||||
27 | |||||||
28 | // Protected Properties |
||||||
29 | // ========================================================================= |
||||||
30 | |||||||
31 | /** |
||||||
0 ignored issues
–
show
|
|||||||
32 | * @var bool|array Allows anonymous access to this controller's actions. |
||||||
33 | * The actions must be in 'kebab-case' |
||||||
34 | * @access protected |
||||||
35 | */ |
||||||
36 | protected $allowAnonymous = [ |
||||||
37 | 'resource' |
||||||
38 | ]; |
||||||
39 | |||||||
40 | // Public Methods |
||||||
41 | // ========================================================================= |
||||||
42 | |||||||
43 | /** |
||||||
44 | * Make webpack async bundle loading work out of published AssetBundles |
||||||
45 | * |
||||||
46 | * @param string $resourceType |
||||||
0 ignored issues
–
show
|
|||||||
47 | * @param string $fileName |
||||||
0 ignored issues
–
show
|
|||||||
48 | * |
||||||
49 | * @return Response |
||||||
50 | */ |
||||||
51 | public function actionResource(string $resourceType = '', string $fileName = ''): Response |
||||||
52 | { |
||||||
53 | $baseAssetsUrl = Craft::$app->assetManager->getPublishedUrl( |
||||||
54 | '@nystudio107/transcoder/assetbundles/transcoder/dist', |
||||||
55 | true |
||||||
0 ignored issues
–
show
The call to
yii\web\AssetManager::getPublishedUrl() has too many arguments starting with true .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.
Loading history...
|
|||||||
56 | ); |
||||||
57 | $url = "{$baseAssetsUrl}/{$resourceType}/{$fileName}"; |
||||||
58 | |||||||
59 | return $this->redirect($url); |
||||||
60 | } |
||||||
61 | } |
||||||
62 |