Passed
Push — master ( 0f9932...7bc3f9 )
by Brent
03:42
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
/**
7
 * @param array                    $params
8
 * @param Smarty_Internal_Template $template
9
 *
10
 * @return mixed
11
 *
12
 * @see \brendt\stitcher\template\EnginePlugin::image()
13
 */
14
function smarty_function_image(array $params, Smarty_Internal_Template $template) {
15
    $plugin = Config::getDependency('engine.plugin');
16
    $src = isset($params['src']) ? $params['src'] : null;
17
    $image = $plugin->image($src);
18
19
    $template->assign($params['var'], $image);
20
}
21