QueuePoolServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 4
c 1
b 1
f 0
lcom 1
cbo 4
dl 0
loc 42
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 16 2
A register() 0 4 1
A provides() 0 6 1
1
<?php
2
3
namespace Wanghanlin\QueuePool;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class QueuePoolServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     */
12
    public function boot()
13
    {
14
        $this->app->singleton('queue.pool', function () {
15
            return new QueuePool($this->app->basePath());
16
        });
17
18
        $this->app->singleton('command.queue.pool', function ($app) {
19
            return new QueuePoolCommand($app['queue.pool']);
20
        });
21
22
        if ($this->app->runningInConsole()) {
23
            $this->commands([
24
                'command.queue.pool',
25
            ]);
26
        }
27
    }
28
29
    /**
30
     * Register the application services.
31
     */
32
    public function register()
33
    {
34
        //
35
    }
36
37
    /**
38
     * Get the services provided by the provider.
39
     *
40
     * @return array
41
     */
42
    public function provides()
43
    {
44
        return [
45
            'queue.pool', 'command.queue.pool',
46
        ];
47
    }
48
}
49