Completed
Pull Request — 2.0.x (#6)
by Andrew
02:53
created

TemplateNotFoundException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A forFullPath() 0 6 1
A forSourcePath() 0 6 1
1
<?php
2
/**
3
 * @author     Andrew Coulton <[email protected]>
4
 * @copyright  2015 inGenerator Ltd
5
 * @license    http://kohanaframework.org/license
6
 */
7
8
namespace Ingenerator\KohanaView\Exception;
9
10
/**
11
 * Thrown when a template cannot be found
12
 *
13
 * @package Ingenerator\KohanaView\Exception
14
 */
15
class TemplateNotFoundException extends \InvalidArgumentException
16
{
17
18
    /**
19
     * @param string $path
20
     *
21
     * @return static
22
     */
23
    public static function forFullPath($path)
24
    {
25
        return new static(
26
            "Failed to include template '$path'"
27
        );
28
    }
29
30
    /**
31
     * @param string $rel_path
32
     *
33
     * @return static
34
     */
35
    public static function forSourcePath($rel_path)
36
    {
37
        return new static(
38
            "Cannot find template source file '$rel_path'"
39
        );
40
    }
41
}
42