Completed
Push — master ( 494091...32c874 )
by David
27s
created

lib/Dwoo/Plugins/Functions/PluginReturnCompile.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * Copyright (c) 2013-2016
4
 *
5
 * @category  Library
6
 * @package   Dwoo\Plugins\Functions
7
 * @author    Jordi Boggiano <[email protected]>
8
 * @author    David Sanchez <[email protected]>
9
 * @copyright 2008-2013 Jordi Boggiano
10
 * @copyright 2013-2016 David Sanchez
11
 * @license   http://dwoo.org/LICENSE Modified BSD License
12
 * @version   1.3.0
13
 * @date      2016-09-19
14
 * @link      http://dwoo.org/
15
 */
16
17
namespace Dwoo\Plugins\Functions;
18
19
use Dwoo\Compiler;
20
21
/**
22
 * Inserts another template into the current one
23
 * <pre>
24
 *  * file : the resource name of the template
25
 *  * cache_time : cache length in seconds
26
 *  * cache_id : cache identifier for the included template
27
 *  * compile_id : compilation identifier for the included template
28
 *  * data : data to feed into the included template, it can be any array and will default to $_root (the current data)
29
 *  * assign : if set, the output of the included template will be saved in this variable instead of being output
30
 *  * rest : any additional parameter/value provided will be added to the data array
31
 * </pre>
32
 * This software is provided 'as-is', without any express or implied warranty.
33
 * In no event will the authors be held liable for any damages arising from the use of this software.
34
 */
35
function PluginReturnCompile(Compiler $compiler, array $rest = array())
0 ignored issues
show
The parameter $compiler is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
36
{
37
    $out = array();
38
    foreach ($rest as $var => $val) {
39
        $out[] = '$this->setReturnValue(' . var_export($var, true) . ', ' . $val . ')';
40
    }
41
42
    return '(' . implode('.', $out) . ')';
43
}
44