Completed
Push — master ( 5de7bb...dc715b )
by Gino
05:11
created

FontAwesomeCssLink   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A componentDetails() 0 7 1
A onRun() 0 10 1
1
<?php
2
3
namespace GinoPane\AwesomeIconsList\Components;
4
5
use Cms\Classes\ComponentBase;
6
use GinoPane\AwesomeIconsList\Plugin;
7
use GinoPane\AwesomeIconsList\Models\Settings;
8
9
10
/**
11
 * Class FontAwesomeCssLink
12
 *
13
 * @package GinoPane\AwesomeIconsList\Components
14
 */
15
class FontAwesomeCssLink extends ComponentBase
16
{
17
    const NAME = 'fontAwesomeCssLink';
18
19
    /**
20
     * Returns information about this component, including name and description
21
     */
22
    public function componentDetails(): array
23
    {
24
        return [
25
            'name'        => Plugin::LOCALIZATION_KEY . 'components.fontawesomecsslink.name',
26
            'description' => Plugin::LOCALIZATION_KEY . 'components.fontawesomecsslink.description'
27
        ];
28
    }
29
30
    /**
31
     * Query the tag and posts belonging to it
32
     */
33
    public function onRun()
34
    {
35
        /** @var Settings $settings */
36
        $settings = Settings::instance();
37
38
        $this->addCss(
39
            $settings->fontAwesomeLink(),
40
            $settings->fontAwesomeLinkAttributes()
41
        );
42
    }
43
}
44