Completed
Pull Request — master (#30)
by
unknown
02:15
created

Steverobbins_Redismanager_Model_Observer   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 52
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A adminhtml_cache_flush_system() 0 9 2
A adminhtml_cache_flush_all() 0 9 2
A _getHelper() 0 7 2
1
<?php
2
3
class Steverobbins_Redismanager_Model_Observer
4
{
5
    /**
6
     * Cached helper
7
     *
8
     * @var Steverobbins_Redismanager_Helper_Data
9
     */
10
    protected $_helper;
11
12
    /**
13
     * @param Varien_Event_Observer $observer
14
     *
15
     * @return $this
16
     */
17
    public function adminhtml_cache_flush_system(Varien_Event_Observer $observer)
0 ignored issues
show
Unused Code introduced by
The parameter $observer is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
18
    {
19
        try {
20
            $this->_getHelper()->flushAllByObserver();
21
        } catch (Exception $e) {
22
            Mage::logException($e);
23
        }
24
        return $this;
25
    }
26
27
    /**
28
     * @param Varien_Event_Observer $observer
29
     *
30
     * @return $this
31
     */
32
    public function adminhtml_cache_flush_all(Varien_Event_Observer $observer)
0 ignored issues
show
Unused Code introduced by
The parameter $observer is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
33
    {
34
        try {
35
            $this->_getHelper()->flushAllByObserver();
36
        } catch (Exception $e) {
37
            Mage::logException($e);
38
        } 
39
        return $this;
40
    }
41
42
    /**
43
     * Get helper
44
     *
45
     * @return Steverobbins_Redismanager_Helper_Data
46
     */
47
     protected function _getHelper()
48
     {
49
         if (is_null($this->_helper)) {
50
             $this->_helper = Mage::helper('redismanager');
51
         }
52
         return $this->_helper;
53
     }
54
}