Test Failed
Push — master ( 3e2d27...57452d )
by Brent
04:10
created

function.image.php ➔ smarty_function_image()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 2
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
use brendt\stitcher\Config;
4
5
/**
6
 * @param array $params
7
 * @param Smarty_Internal_Template $template
8
 */
9
function smarty_function_image(array $params, Smarty_Internal_Template $template) {
10
    $plugin = Config::getDependency('engine.plugin');
11
    $src = isset($params['src']) ? $params['src'] : null;
12
    $image = $plugin->image($src);
13
14
    $template->assign($params['var'], $image);
15
}
16