Completed
Push — master ( fe0f99...6b22ab )
by Nate
03:54
created

AbstractType::getProperties()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 10
c 0
b 0
f 0
ccs 0
cts 8
cp 0
rs 9.4285
cc 2
eloc 5
nc 2
nop 0
crap 6
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/link/license
6
 * @link       https://www.flipboxfactory.com/software/link/
7
 */
8
9
namespace flipbox\link\types;
10
11
use Craft;
12
use craft\base\ElementInterface;
13
use flipbox\link\fields\Link;
14
use yii\base\Model;
15
16
/**
17
 * @author Flipbox Factory <[email protected]>
18
 * @since 1.0.0
19
 */
20
abstract class AbstractType extends Model implements TypeInterface
21
{
22
    use traits\Base;
23
24
    /**
25
     * @inheritdoc
26
     */
27
    public static function displayName(): string
28
    {
29
        $ref = new \ReflectionClass(static::class);
30
        return Craft::t('link', $ref->getShortName());
31
    }
32
33
    /**
34
     * @inheritdoc
35
     */
36
    public function settingsHtml(): string
37
    {
38
        return Craft::$app->getView()->renderTemplate(
39
            'link/_components/fieldtypes/Link/types/settings',
40
            [
41
                'type' => $this
42
            ]
43
        );
44
    }
45
46
    /**
47
     * @inheritdoc
48
     */
49
    public function inputHtml(Link $field, TypeInterface $value = null, ElementInterface $element = null): string
50
    {
51
        return '';
52
    }
53
}
54