RepositoryServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 2
c 0
b 0
f 0
nc 2
nop 0
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 2
rs 10
1
<?php
2
3
namespace Mblarsen\LaravelRepository;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class RepositoryServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     */
12 74
    public function boot()
13
    {
14 74
        if ($this->app->environment('testing')) {
15 74
            $this->loadMigrationsFrom([__DIR__ . '/../tests/migrations']);
16
        }
17 74
    }
18
19
    /**
20
     * Register the application services.
21
     */
22 74
    public function register()
23
    {
24
        // Bind the default ResourceContext if not bound by user already
25 74
        if (!$this->app->bound(ResourceContext::class)) {
26 74
            $this->app->bind(ResourceContext::class, RequestResourceContext::class);
27
        }
28 74
    }
29
}
30