Completed
Push — develop ( f37ae4...1d947e )
by Nate
18:30
created

Events   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 26
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 20 1
1
<?php
2
3
namespace flipbox\hubspot\patron;
4
5
use flipbox\hubspot\patron\providers\HubSpotSettings;
6
use Flipbox\OAuth2\Client\Provider\HubSpot as HubSpotProvider;
7
use flipbox\patron\cp\Cp;
8
use flipbox\patron\events\RegisterProviders;
9
use flipbox\patron\events\RegisterProviderSettings;
10
use yii\base\Event;
11
12
class Events
13
{
14
    /**
15
     * Register events
16
     */
17
    public static function register()
18
    {
19
        // OAuth2 Provider
20
        Event::on(
21
            Cp::class,
22
            Cp::EVENT_REGISTER_PROVIDERS,
23
            function (RegisterProviders $event) {
24
                $event->providers[] = HubSpotProvider::class;
25
            }
26
        );
27
28
        // OAuth2 Provider Settings
29
        RegisterProviderSettings::on(
30
            HubSpotProvider::class,
31
            RegisterProviderSettings::REGISTER_SETTINGS,
32
            function (RegisterProviderSettings $event) {
33
                $event->class = HubSpotSettings::class;
34
            }
35
        );
36
    }
37
}
38