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

UndefinedViewVarException::forClassAndVar()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4286
cc 1
eloc 3
nc 1
nop 2
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 attempting to access a view variable that is not defined
12
 *
13
 * @package Ingenerator\KohanaView\Exception
14
 */
15
class UndefinedViewVarException extends \BadMethodCallException
16
{
17
18
    /**
19
     * @param string $view_class
20
     * @param string $var_name
21
     *
22
     * @return static
23
     */
24
    public static function forClassAndVar($view_class, $var_name)
25
    {
26
        return new static(
27
            "$view_class does not define a '$var_name' field"
28
        );
29
    }
30
}
31