ApiExceptionHandlerProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 7 1
A register() 0 3 1
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