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

_getHelper()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
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
}