Completed
Push — master ( aef338...f2de0d )
by Damien
02:37
created

RouterException::noRouteExists()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
/**
3
 * Veto.
4
 * PHP Microframework.
5
 *
6
 * @author Damien Walsh <[email protected]>
7
 * @copyright Damien Walsh 2013-2014
8
 * @version 0.1
9
 * @package veto
10
 */
11
namespace Veto\Layer\Router\Exception;
12
13
/**
14
 * RouterException
15
 *
16
 * Represents a problem with the router layer.
17
 *
18
 * @since 0.1
19
 */
20
class RouterException extends \Exception
21
{
22
    public static function noRouteExists($method, $path)
23
    {
24
        return new self(
25
            sprintf('No route defined for %s %s', $method, $path), 404
26
        );
27
    }
28
29
    public static function nonExistentRoute($route)
30
    {
31
        return new self(
32
            sprintf('The route %s does not exist.', $route), 500
33
        );
34
    }
35
}
36