Passed
Push — develop ( 119dfd...2d7b42 )
by Brent
02:44
created

function.file.php ➔ smarty_function_file()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
use Brendt\Stitcher\Stitcher;
4
use Brendt\Stitcher\Template\TemplatePlugin;
5
6
/**
7
 * @param $params
8
 *
9
 * @return mixed
10
 *
11
 * @see \Brendt\Stitcher\Template\EnginePlugin::css()
12
 */
13
function smarty_function_file($params) {
14
    /** @var TemplatePlugin $plugin */
15
    $plugin = Stitcher::get('service.template.plugin');
16
17
    $src = isset($params['src']) ? $params['src'] : null;
18
19
    return $plugin->file($src);
20
}
21