ResolvePathArgs   A
last analyzed

Coupling/Cohesion

Components 1
Dependencies 1

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

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 72
    public function __construct($path, array $context, Template $template) {
14 72
        $this->path = $path;
15 72
        $this->context = $context;
16 72
        $this->template = $template;
17 72
    }
18
19 48
    public function withPath($path) {
20 48
        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 20
    public static function fromTemplate(Template $template) {
28 20
        return new self($template->name, [], clone $template);
29
    }
30
}
31