FuncArgs::template()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
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 76
    public function __construct(Plates\RenderTemplate $render, Plates\TemplateReference $ref, $func_name, $args = []) {
15 76
        $this->render = $render;
16 76
        $this->ref = $ref;
17 76
        $this->func_name = $func_name;
18 76
        $this->args = $args;
19 76
    }
20
21 76
    public function template() {
22 76
        return $this->ref->template;
23
    }
24
25 4
    public function withName($func_name) {
26 4
        return new self($this->render, $this->ref, $func_name, $this->args);
27
    }
28 56
    public function withArgs($args) {
29 56
        return new self($this->render, $this->ref, $this->func_name, $args);
30
    }
31
}
32