Main::getActionHandlers()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * @package Image
5
 * @author Iurii Makukh
6
 * @copyright Copyright (c) 2017, Iurii Makukh
7
 * @license https://www.gnu.org/licenses/gpl-3.0.en.html GPL-3.0+
8
 */
9
10
namespace gplcart\modules\image;
11
12
use gplcart\core\Module;
13
14
/**
15
 * Main class for Image module
16
 */
17
class Main
18
{
19
20
    /**
21
     * Module class instance
22
     * @var \gplcart\core\Module $module
23
     */
24
    protected $module;
25
26
    /**
27
     * @param Module $module
28
     */
29
    public function __construct(Module $module)
30
    {
31
        $this->module = $module;
32
    }
33
34
    /**
35
     * Implements hook "library.list"
36
     * @param array $libraries
37
     */
38
    public function hookLibraryList(array &$libraries)
39
    {
40
        $libraries['simpleimage'] = array(
41
            'name' => 'SimpleImage', // @text
42
            'description' => 'A PHP class that simplifies working with images', // @text
43
            'type' => 'php',
44
            'module' => 'image',
45
            'url' => 'https://github.com/claviska/SimpleImage',
46
            'download' => 'https://github.com/claviska/SimpleImage/archive/3.3.0.zip',
47
            'version' => '3.3.0',
48
            'vendor' => 'claviska/simpleimage'
49
        );
50
    }
51
52
    /**
53
     * Implements hook "image.style.action.handlers"
54
     * @param array $handlers
55
     */
56
    public function hookImageStyleActionHandlers(array &$handlers)
57
    {
58
        $handlers = array_merge($handlers, $this->getActionHandlers());
59
    }
60
61
    /**
62
     * Returns an array of image style actions
63
     * @return array
64
     */
65
    public function getActionHandlers()
66
    {
67
        return gplcart_config_get(__DIR__ . '/config/actions.php');
68
    }
69
70
}
71