Interval   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
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 19
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 13 1
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/interval/license
6
 * @link       https://www.flipboxfactory.com/software/interval/
7
 */
8
9
namespace flipbox\interval;
10
11
use craft\base\Plugin;
12
use craft\events\RegisterComponentTypesEvent;
13
use craft\services\Fields;
14
use flipbox\interval\fields\Interval as IntervalField;
15
use yii\base\Event;
16
17
/**
18
 * @author Flipbox Factory <[email protected]>
19
 * @since 1.0.0
20
 */
21
class Interval extends Plugin
22
{
23
    /**
24
     * @inheritdoc
25
     */
26
    public function init()
27
    {
28
        parent::init();
29
30
        // Register our field types
31
        Event::on(
32
            Fields::class,
33
            Fields::EVENT_REGISTER_FIELD_TYPES,
34
            function (RegisterComponentTypesEvent $event) {
35
                $event->types[] = IntervalField::class;
36
            }
37
        );
38
    }
39
}
40