Domains   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 30
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 14 1
A getLogFileName() 0 4 1
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/domains/license
6
 * @link       https://www.flipboxfactory.com/software/domains/
7
 */
8
9
namespace flipbox\craft\domains;
10
11
use craft\base\Plugin as BasePlugin;
12
use craft\events\RegisterComponentTypesEvent;
13
use craft\services\Fields;
14
use flipbox\craft\ember\modules\LoggerTrait;
15
use flipbox\craft\domains\fields\Domains as DomainsField;
16
use yii\base\Event;
17
18
/**
19
 * @author Flipbox Factory <[email protected]>
20
 * @since  1.0.0
21
 */
22
class Domains extends BasePlugin
23
{
24
    use LoggerTrait;
25
26
    /**
27
     * @inheritdoc
28
     */
29
    public function init()
30
    {
31
        // Do parent
32
        parent::init();
33
34
        // Register our fields
35
        Event::on(
36
            Fields::class,
37
            Fields::EVENT_REGISTER_FIELD_TYPES,
38
            function (RegisterComponentTypesEvent $event) {
39
                $event->types[] = DomainsField::class;
40
            }
41
        );
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    protected static function getLogFileName(): string
48
    {
49
        return 'domains';
50
    }
51
}
52