ApiExceptionHandlerProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace PHPHub\Providers;
4
5
use Illuminate\Database\Eloquent\ModelNotFoundException;
6
use Illuminate\Support\ServiceProvider;
7
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
8
9
class ApiExceptionHandlerProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the application services.
13
     */
14
    public function boot()
15
    {
16
        $handler = app('api.exception');
17
        $handler->register(function (ModelNotFoundException $exception) {
0 ignored issues
show
Unused Code introduced by
The parameter $exception is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
18
            throw new NotFoundHttpException();
19
        });
20
    }
21
22
    /**
23
     * Register the application services.
24
     */
25
    public function register()
26
    {
27
    }
28
}
29