Completed
Push — master ( a4ae76...9ba14f )
by Timo
02:46
created

LaravelGuzzleThrottleServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 28
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A register() 0 5 1
1
<?php
2
3
namespace hamburgscleanest\LaravelGuzzleThrottle;
4
5
use hamburgscleanest\LaravelGuzzleThrottle\Models\GuzzleThrottle;
6
use Illuminate\Support\ServiceProvider;
7
8
/**
9
 * Class LaravelGuzzleThrottleServiceProvider
10
 * @package hamburgscleanest\LaravelGuzzleThrottle
11
 */
12
class LaravelGuzzleThrottleServiceProvider extends ServiceProvider
13
{
14
15
    /**
16
     * Perform post-registration booting of services.
17
     *
18
     * @return void
19
     */
20 4
    public function boot() : void
21
    {
22 4
        $this->publishes([
23 4
            __DIR__ . '/config.php' => \config_path('laravel-guzzle-throttle.php')
24
        ]);
25 4
    }
26
27
    /**
28
     * Register any package services.
29
     *
30
     * @return void
31
     * @throws \hamburgscleanest\GuzzleAdvancedThrottle\Exceptions\UnknownStorageAdapterException
32
     * @throws \hamburgscleanest\GuzzleAdvancedThrottle\Exceptions\UnknownCacheStrategyException
33
     * @throws \Exception
34
     */
35
    public function register() : void
36
    {
37 4
        $this->app->singleton('laravel-guzzle-throttle', function()
38
        {
39 1
            return new GuzzleThrottle();
40 4
        });
41
    }
42
}