Passed
Pull Request — master (#7)
by Choraimy
02:56
created

Callbacks   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 21
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A notFound() 0 3 1
A redirectTo() 0 3 1
1
<?php
2
3
namespace LaraCrafts\GeoRoutes;
4
5
use Symfony\Component\HttpKernel\Exception\HttpException;
6
7
class Callbacks
8
{
9
    /**
10
     * Return a HTTP 404 Not Found response.
11
     *
12
     * @throws \Symfony\Component\HttpKernel\Exception\HttpException
13
     */
14
    public static function notFound()
15
    {
16
        throw new HttpException(404);
17
    }
18
19
    /**
20
     * Redirect to given route.
21
     *
22
     * @param string $route
23
     * @return \Illuminate\Http\RedirectResponse
24
     */
25
    public static function redirectTo(string $route)
26
    {
27
        return redirect()->route($route);
28
    }
29
}
30