RotateFilterLoader   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 6 3
1
<?php
2
3
/*
4
 * This file is part of the `liip/LiipImagineBundle` project.
5
 *
6
 * (c) https://github.com/liip/LiipImagineBundle/graphs/contributors
7
 *
8
 * For the full copyright and license information, please view the LICENSE.md
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Liip\ImagineBundle\Imagine\Filter\Loader;
13
14
use Imagine\Image\ImageInterface;
15
use Imagine\Image\ManipulatorInterface;
16
17
/**
18
 * Loader for Imagine's basic rotate method.
19
 *
20
 * @author Bocharsky Victor <[email protected]>
21
 */
22
class RotateFilterLoader implements LoaderInterface
23
{
24
    /**
25
     * Loads and applies a filter on the given image.
26
     *
27
     * @return ManipulatorInterface
28
     */
29
    public function load(ImageInterface $image, array $options = [])
30
    {
31
        $angle = isset($options['angle']) ? (int) $options['angle'] : 0;
32
33
        return 0 === $angle ? $image : $image->rotate($angle);
34
    }
35
}
36