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

RouterException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A noRouteExists() 0 6 1
A nonExistentRoute() 0 6 1
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