Permalink
Browse files

Fixed missing param and renamed interface param name

- Added missing param for array_key_exists calls
- Renamed $type to $scheme within ImageInterface::interlace
  • Loading branch information...
1 parent 3c93c1b commit bf01c45e930e72b1db53410499214410cee62652 @anthonysterling anthonysterling committed Feb 3, 2013
View
@@ -483,20 +483,20 @@ public function layers()
/**
* {@inheritdoc}
**/
- public function interlace($type)
+ public function interlace($scheme)
{
- static $supportedInterlaceTypes = array(
+ static $supportedInterlaceSchemes = array(
ImageInterface::INTERLACE_NONE => 0,
ImageInterface::INTERLACE_LINE => 1,
ImageInterface::INTERLACE_PLANE => 1,
ImageInterface::INTERLACE_PARTITION => 1,
);
- if (!array_key_exists($supportedInterlaceTypes)) {
+ if (!array_key_exists($scheme, $supportedInterlaceSchemes)) {
throw new InvalidArgumentException('Unsupported interlace type');
}
- imageinterlace($this->resource, $supportedInterlaceTypes[$type]);
+ imageinterlace($this->resource, $supportedInterlaceSchemes[$scheme]);
return $this;
}
@@ -546,20 +546,20 @@ public function layers()
/**
* {@inheritdoc}
**/
- public function interlace($type)
+ public function interlace($scheme)
{
- static $supportedInterlaceTypes = array(
+ static $supportedInterlaceSchemes = array(
ImageInterface::INTERLACE_NONE => \Gmagick::INTERLACE_NO,
ImageInterface::INTERLACE_LINE => \Gmagick::INTERLACE_LINE,
ImageInterface::INTERLACE_PLANE => \Gmagick::INTERLACE_PLANE,
ImageInterface::INTERLACE_PARTITION => \Gmagick::INTERLACE_PARITION,
);
- if (!array_key_exists($supportedInterlaceTypes)) {
+ if (!array_key_exists($scheme, $supportedInterlaceSchemes)) {
throw new InvalidArgumentException('Unsupported interlace type');
}
- $this->gmagick->setInterlaceScheme($supportedInterlaceTypes[$type]);
+ $this->gmagick->setInterlaceScheme($supportedInterlaceSchemes[$scheme]);
return $this;
}
@@ -111,9 +111,11 @@ public function layers();
/**
* Enables or disables interlacing
*
+ * @param string $scheme
+ *
* @throws InvalidArgumentException When an unsupported Interface type is supplied
*
* @return ImageInterface
*/
- public function interlace($type);
+ public function interlace($scheme);
}
@@ -285,20 +285,20 @@ public function get($format, array $options = array())
/**
* {@inheritdoc}
**/
- public function interlace($type)
+ public function interlace($scheme)
{
- static $supportedInterlaceTypes = array(
+ static $supportedInterlaceSchemes = array(
ImageInterface::INTERLACE_NONE => \Imagick::INTERLACE_NO,
ImageInterface::INTERLACE_LINE => \Imagick::INTERLACE_LINE,
ImageInterface::INTERLACE_PLANE => \Imagick::INTERLACE_PLANE,
ImageInterface::INTERLACE_PARTITION => \Imagick::INTERLACE_PARITION,
);
- if (!array_key_exists($supportedInterlaceTypes)) {
+ if (!array_key_exists($scheme, $supportedInterlaceSchemes)) {
throw new InvalidArgumentException('Unsupported interlace type');
}
- $this->imagick->setInterlaceScheme($supportedInterlaceTypes[$type]);
+ $this->imagick->setInterlaceScheme($supportedInterlaceSchemes[$scheme]);
return $this;
}

0 comments on commit bf01c45

Please sign in to comment.