Callbacks::redirectTo()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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 32
    public static function notFound()
15
    {
16 32
        throw new HttpException(404);
17
    }
18
19
    /**
20
     * Redirect to given route.
21
     *
22
     * @param string $route
23
     * @return \Illuminate\Http\RedirectResponse
24
     */
25 32
    public static function redirectTo(string $route)
26
    {
27 32
        return redirect()->route($route);
28
    }
29
}
30