eZ\Bundle\EzPublishCoreBundle\Imagine\Filter\Loader\SwirlFilterLoader::load PHP Method

load() public method

public load ( Imagine\Image\ImageInterface $image, array $options = [] )
$image Imagine\Image\ImageInterface
$options array
    public function load(ImageInterface $image, array $options = array())
    {
        if (!empty($options)) {
            $this->filter->setOption('degrees', $options[0]);
        }
        return $this->filter->apply($image);
    }

Usage Example

 /**
  * @dataProvider loadWithOptionProvider
  */
 public function testLoadWithOption($degrees)
 {
     $image = $this->getMock('\\Imagine\\Image\\ImageInterface');
     $this->filter->expects($this->once())->method('setOption')->with('degrees', $degrees);
     $this->filter->expects($this->once())->method('apply')->with($image)->will($this->returnValue($image));
     $this->assertSame($image, $this->loader->load($image, array($degrees)));
 }
SwirlFilterLoader