GenderizeServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 3
c 2
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Pixelpeter\Genderize;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class GenderizeServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
        $this->mergeConfigFrom(__DIR__ . '/../config/genderize.php', 'genderize');
17
18
        $this->publishes([
19
            __DIR__ . '/../config/genderize.php' => config_path('genderize.php'),
20
        ]);
21
    }
22
23
    /**
24
     * Register the application services.
25
     *
26
     * @return void
27
     */
28
    public function register()
29
    {
30
        $app = $this->app;
31
32
        $app->bind('Pixelpeter\Genderize\GenderizeClient', function () {
33
            return new GenderizeClient(new \Unirest\Request);
34
        });
35
36
        $app->alias('Pixelpeter\Genderize\GenderizeClient', 'genderize');
37
    }
38
}
39