Completed
Push — extensions ( 84a6ae )
by
unknown
22:00 queued 07:01
created

FuncArgs::withName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace League\Plates\Extension\RenderContext;
4
5
use League\Plates;
6
7
final class FuncArgs
8
{
9
    public $render;
10
    public $ref;
11
    public $func_name;
12
    public $args;
13
14
    public function __construct(Plates\RenderTemplate $render, Plates\TemplateReference $ref, $func_name, $args = []) {
15
        $this->render = $render;
16
        $this->ref = $ref;
17
        $this->func_name = $func_name;
18
        $this->args = $args;
19
    }
20
21
    public function template() {
22
        return $this->ref->template;
23
    }
24
25
    public function withName($func_name) {
26
        return new self($this->render, $this->ref, $func_name, $this->args);
27
    }
28
    public function withArgs($args) {
29
        return new self($this->render, $this->ref, $this->func_name, $args);
30
    }
31
}
32