Main   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 39
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A hookRouteList() 0 9 1
A hookJobHandlers() 0 8 1
A hookCronRunAfter() 0 4 1
1
<?php
2
3
/**
4
 * @package Skeleton module
5
 * @author Iurii Makukh <[email protected]>
6
 * @copyright Copyright (c) 2015, Iurii Makukh
7
 * @license https://www.gnu.org/licenses/gpl.html GNU/GPLv3
8
 */
9
10
namespace gplcart\modules\skeleton;
11
12
/**
13
 * Main class for Skeleton module
14
 */
15
class Main
16
{
17
18
    /**
19
     * Implements hook "route.list"
20
     * @param array $routes
21
     */
22
    public function hookRouteList(array &$routes)
23
    {
24
        $routes['admin/tool/skeleton'] = array(
25
            'menu' => array('admin' => 'Skeleton'),
26
            'handlers' => array(
27
                'controller' => array('gplcart\\modules\\skeleton\\controllers\\Skeleton', 'editSkeleton')
28
            )
29
        );
30
    }
31
32
    /**
33
     * Implements hook "job.handlers"
34
     * @param array $handlers
35
     */
36
    public function hookJobHandlers(array &$handlers)
37
    {
38
        $handlers['skeleton'] = array(
39
            'handlers' => array(
40
                'process' => array('gplcart\\modules\\skeleton\\handlers\\Extract', 'process')
41
            ),
42
        );
43
    }
44
45
    /**
46
     * Implements hook "cron.run.after"
47
     */
48
    public function hookCronRunAfter()
49
    {
50
        gplcart_file_empty(gplcart_file_private_module('skeleton'), array('zip'), 24 * 60 * 60);
51
    }
52
53
}
54