LimeSoda_LiveGuard_Helper_Data   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 22
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A assertCurrEnvConfigEqualsSysConfig() 0 9 3
1
<?php
2
3
class LimeSoda_LiveGuard_Helper_Data extends Mage_Core_Helper_Abstract
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
     * Asserts that the system configuration value equals the environment
7
     * configuration value specified in XML for the current enviroment.
8
     * 
9
     * @throws Exception
10
     * @param string $variable Variable name used in the environment configuration XML
11
     * @param string $path System configuration path
12
     * @param mixed $store Store (if you want to check for a specific store-view)
13
     * @return void
14
     */
15
    public function assertCurrEnvConfigEqualsSysConfig($variable, $path, $store = null)
16
    {
17
        $expected = Mage::helper('limesoda_environmentconfiguration/current')->getValue($variable);
18
        $actual = Mage::getStoreConfig($path, $store);
19
        
20
        if ($expected != $actual) {
21
            throw new Exception("The value of environment configuration variable '$variable' did not match the system configuration value of '$path'" . (!is_null($store) ? " (store '$store')" : '') . ". Expected: $expected, actual: $actual");
22
        }
23
    }
24
}
25