Test Failed
Push — master ( a6b51e...5fffdb )
by Gabriel
08:05
created

HelloServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 30.76%

Importance

Changes 0
Metric Value
dl 0
loc 35
rs 10
c 0
b 0
f 0
ccs 4
cts 13
cp 0.3076
wmc 3
lcom 0
cbo 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 5 1
A provides() 0 8 1
A boot() 0 5 1
1
<?php
2
3
namespace ByTIC\Hello;
4
5
use ByTIC\Hello\Oauth\Routes\RouteRegistrar;
6
use ByTIC\Hello\Oauth\ServiceProvider\Traits\AuthorizationServerTrait;
7
use ByTIC\Hello\Oauth\ServiceProvider\Traits\RepositoriesTrait;
8
use League\OAuth2\Server\AuthorizationServer;
9
use Nip\Container\ServiceProviders\Providers\AbstractSignatureServiceProvider;
10
use Nip\Container\ServiceProviders\Providers\BootableServiceProviderInterface;
11
12
/**
13
 * Class HelloServiceProvider
14
 * @package ByTIC\Auth
15
 */
16
class HelloServiceProvider extends AbstractSignatureServiceProvider implements BootableServiceProviderInterface
17
{
18
    use RepositoriesTrait;
19
    use AuthorizationServerTrait;
20
21
    /**
22
     * @inheritdoc
23
     */
24
    public function register()
25
    {
26
        $this->registerRepositories();
27
        $this->registerAuthorizationServer();
28
    }
29
30
    /**
31
     * @inheritdoc
32
     */
33
    public function provides()
34
    {
35
        $return = ['hello.server', AuthorizationServer::class];
36
37
        $return = $this->appendRepositoriesToProvide($return);
38
        $return = $this->appendCryptKeysToProvide($return);
39
        return $return;
40
    }
41
42
    /**
43
     * @inheritDoc
44
     */
45 1
    public function boot()
46
    {
47 1
        $router = $this->getContainer()->get('router');
48 1
        (new RouteRegistrar($router))->all();
49 1
    }
50
}
51