FuncArgs   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 25
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A template() 0 3 1
A withName() 0 3 1
A withArgs() 0 3 1
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