ResolvePathArgs   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 81.82%

Importance

Changes 0
Metric Value
dl 0
loc 24
ccs 9
cts 11
cp 0.8182
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A withPath() 0 3 1
A withContext() 0 3 1
A fromTemplate() 0 3 1
1
<?php
2
3
namespace League\Plates\Extension\Path;
4
5
use League\Plates\Template;
6
7
class ResolvePathArgs
8
{
9
    public $path;
10
    public $context;
11
    public $template;
12
13 76
    public function __construct($path, array $context, Template $template) {
14 76
        $this->path = $path;
15 76
        $this->context = $context;
16 76
        $this->template = $template;
17 76
    }
18
19 52
    public function withPath($path) {
20 52
        return new self($path, $this->context, $this->template);
21
    }
22
23
    public function withContext(array $context) {
24
        return new self($this->path, $context, $this->template);
25
    }
26
27 24
    public static function fromTemplate(Template $template) {
28 24
        return new self($template->name, [], clone $template);
29
    }
30
}
31