Completed
Push — master ( 319645...655917 )
by Lukas Kahwe
14s
created

UpscaleFilterLoader   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 17
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A calcAbsoluteRatio() 0 4 1
A 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