protected function getFilterInstance($type)
	{
		// Sanitize the filter type.
		$type = strtolower(preg_replace('#[^A-Z0-9_]#i', '', $type));

		// Verify that the filter type exists.
		$className = 'Joomla\\Image\\Filter\\' . ucfirst($type);

		if (!class_exists($className))
		{
			$this->getLogger()->error('The ' . ucfirst($type) . ' image filter is not available.');

			throw new \RuntimeException('The ' . ucfirst($type) . ' image filter is not available.');
		}

		// Instantiate the filter object.
		$instance = new $className($this->handle);

		// Verify that the filter type is valid.
		if (!($instance instanceof ImageFilter))
		{
			// @codeCoverageIgnoreStart
			$this->getLogger()->error('The ' . ucfirst($type) . ' image filter is not valid.');

			throw new \RuntimeException('The ' . ucfirst($type) . ' image filter is not valid.');

			// @codeCoverageIgnoreEnd
		}

		return $instance;
	}
protected function getFilterInstance($type)
	{
		// Sanitize the filter type.
		$type = strtolower(preg_replace('#[^A-Z0-9_]#i', '', $type));

		// Verify that the filter type exists.
		$className = 'Joomla\\Image\\Filter\\' . ucfirst($type);

		if (!class_exists($className))
		{
			$this->getLogger()->error('The ' . ucfirst($type) . ' image filter is not available.');

			throw new \RuntimeException('The ' . ucfirst($type) . ' image filter is not available.');
		}

		// Instantiate the filter object.
		$instance = new $className($this->handle);

		// Verify that the filter type is valid.
		if (!($instance instanceof ImageFilter))
		{
			// @codeCoverageIgnoreStart
			$this->getLogger()->error('The ' . ucfirst($type) . ' image filter is not valid.');

			throw new \RuntimeException('The ' . ucfirst($type) . ' image filter is not valid.');

			// @codeCoverageIgnoreEnd
		}

		return $instance;
	}
protected function getFilterInstance ( $ type ) { // Sanitize the filter type. $ type = strtolower ( preg_replace ( '#[^A-Z0-9_]#i' , '' , $ type ) ) ; // Verify that the filter type exists. $ className = 'Joomla\\Image\\Filter\\' . ucfirst ( $ type ) ; if ( ! class_exists ( $ className ) ) { $ this -> getLogger ( ) -> error ( 'The ' . ucfirst ( $ type ) . ' image filter is not available.' ) ; throw new \ RuntimeException ( 'The ' . ucfirst ( $ type ) . ' image filter is not available.' ) ; } // Instantiate the filter object. $ instance = new $ className ( $ this -> handle ) ; // Verify that the filter type is valid. if ( ! ( $ instance instanceof ImageFilter ) ) { // @codeCoverageIgnoreStart $ this -> getLogger ( ) -> error ( 'The ' . ucfirst ( $ type ) . ' image filter is not valid.' ) ; throw new \ RuntimeException ( 'The ' . ucfirst ( $ type ) . ' image filter is not valid.' ) ; // @codeCoverageIgnoreEnd } return $ instance ; }
Method to get an image filter instance of a specified type.

@param   string  $type  The image filter type to get.

@return  ImageFilter

@since   1.0
@throws  \RuntimeException
Method to get an image filter instance of a specified type .