controllerFrontInitBefore()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 3
eloc 7
nc 3
nop 1
dl 0
loc 14
rs 9.4285
1
<?php
2
3
class LimeSoda_LiveGuard_Model_Observer
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
{
5
    /**
6
     * @SuppressWarnings("UnusedFormalParameter")
7
     * @param Varien_Event_Observer $observer
8
     * @return LimeSoda_LiveGuard_Model_Observer
9
     */
10
    public function controllerFrontInitBefore(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...
11
    {
12
        $config = Mage::getModel('limesoda_liveguard/config');
13
        
14
        if (!$config->configExists()) {
15
            return $this;
16
        }
17
        
18
        foreach ($config->getGuards() as $guard) {
19
                $guard->process();
20
        }
21
        
22
        return $this;
23
    }
24
}
25