Skip to content

Commit

Permalink
Compatibility for PHP 5.3
Browse files Browse the repository at this point in the history
Function array dereferencing is not backward compatible so has been
removed.
  • Loading branch information
clockworkgeek committed Mar 20, 2015
1 parent dd229a5 commit 20585de
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public function isDisplayFrontendBanner()
}

// Check that the given environment is recognised, else false
if (!isset($this->getEnvironments()[$this->getEnvironment()])) {
$environments = $this->getEnvironments();
if (!isset($environments[$this->getEnvironment()])) {
return false;
}

Expand All @@ -55,7 +56,8 @@ public function isDisplayAdminBanner()
}

// Check that the given environment is recognised, else false
if (!isset($this->getEnvironments()[$this->getEnvironment()])) {
$environments = $this->getEnvironments();
if (!isset($environments[$this->getEnvironment()])) {
return false;
}

Expand Down Expand Up @@ -97,10 +99,11 @@ public function getEnvColours()
{
// Lazily load colours from environment data
if ($this->_colours === null) {
if (!isset($this->getEnvironments()[$this->getEnvironment()])) {
$environments = $this->getEnvironments();
if (!isset($environments[$this->getEnvironment()])) {
return null;
}
$data = $this->getEnvironments()[$this->getEnvironment()];
$data = $environments[$this->getEnvironment()];
$this->_colours = Mage::getModel('c3_environmentbanner/colours')
->setData($data);
}
Expand Down

0 comments on commit 20585de

Please sign in to comment.