Completed
Pull Request — master (#773)
by
unknown
03:15
created

UpscaleFilterLoader::load()   B

Complexity

Conditions 5
Paths 4

Size

Total Lines 25
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 8.439
c 0
b 0
f 0
cc 5
eloc 14
nc 4
nop 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A UpscaleFilterLoader::isImageProcessable() 0 4 1
1
<?php
2
3
namespace Liip\ImagineBundle\Imagine\Filter\Loader;
4
5
/**
6
 * Upscale filter.
7
 *
8
 * @author Maxime Colin <[email protected]>
9
 * @author Devi Prasad <https://github.com/deviprsd21>
10
 */
11
class UpscaleFilterLoader extends ScaleFilterLoader
12
{
13
    public function __construct()
14
    {
15
        parent::__construct('min', 'by', false);
16
    }
17
18
    protected function calcAbsoluteRatio($ratio)
19
    {
20
        return 1 + $ratio;
21
    }
22
23
    protected function isImageProcessable($ratio)
24
    {
25
        return $ratio > 1;
26
    }
27
}
28