Skip to content

Commit

Permalink
Replace filter_var to make the intention of the code clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
joost-florijn-kega authored Nov 2, 2016
1 parent ed946c0 commit 1bbcff4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/code/Magento/Catalog/Model/Product/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public function getQuality()
*/
public function setKeepAspectRatio($keep)
{
$this->_keepAspectRatio = filter_var($keep, FILTER_VALIDATE_BOOLEAN);
$this->_keepAspectRatio = $keep && $keep !== 'false';
return $this;
}

Expand All @@ -288,7 +288,7 @@ public function setKeepAspectRatio($keep)
*/
public function setKeepFrame($keep)
{
$this->_keepFrame = filter_var($keep, FILTER_VALIDATE_BOOLEAN);
$this->_keepFrame = $keep && $keep !== 'false';
return $this;
}

Expand All @@ -298,7 +298,7 @@ public function setKeepFrame($keep)
*/
public function setKeepTransparency($keep)
{
$this->_keepTransparency = filter_var($keep, FILTER_VALIDATE_BOOLEAN);
$this->_keepTransparency = $keep && $keep !== 'false';
return $this;
}

Expand All @@ -308,7 +308,7 @@ public function setKeepTransparency($keep)
*/
public function setConstrainOnly($flag)
{
$this->_constrainOnly = filter_var($flag, FILTER_VALIDATE_BOOLEAN);
$this->_constrainOnly = $flag && $flag !== 'false';
return $this;
}

Expand Down

0 comments on commit 1bbcff4

Please sign in to comment.