Plugin   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 53
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A registerComponents() 0 7 1
A pluginDetails() 0 10 1
A registerMarkupTags() 0 14 2
1
<?php namespace PKleindienst\BlogSearch;
2
3
use System\Classes\PluginBase;
4
5
/**
6
 * blogSearch Plugin Information File
7
 */
8
class Plugin extends PluginBase
9
{
10
    /**
11
     * @var array Plugin dependencies
12
     */
13
    public $require = ['RainLab.Blog'];
14
15
    /**
16
     * Returns information about this plugin.
17
     *
18
     * @return array
19
     */
20
    public function pluginDetails()
21
    {
22
        return [
23
            'name'        => 'Blog Search',
24
            'description' => 'Adds a search function to the blog',
25
            'author'      => 'Pascal Kleindienst',
26
            'icon'        => 'icon-search',
27
            'homepage'    => 'https://github.com/PascalKleindienst/october-blogsearch-extension'
28
        ];
29
    }
30
31
    /**
32
     * @return array
33
     */
34
    public function registerComponents()
35
    {
36
        return [
37
            'PKleindienst\BlogSearch\Components\SearchForm'   => 'searchForm',
38
            'PKleindienst\BlogSearch\Components\SearchResult' => 'searchResult'
39
        ];
40
    }
41
42
    /**
43
     * Register new Twig variables
44
     * @return array
45
     */
46
    public function registerMarkupTags()
47
    {
48
        // Check the translate plugin is installed
49
        if (class_exists('RainLab\Translate\Behaviors\TranslatableModel')) {
50
            return [];
51
        }
52
53
        return [
54
            'filters' => [
55
                '_'  => ['Lang', 'get'],
56
                '__' => ['Lang', 'choice']
57
            ]
58
        ];
59
    }
60
}
61