UpscaleFilterLoader   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 17
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1
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
/*
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
/**
15
 * Upscale filter.
16
 *
17
 * @author Maxime Colin <[email protected]>
18
 * @author Devi Prasad <https://github.com/deviprsd21>
19
 */
20
class UpscaleFilterLoader extends ScaleFilterLoader
21
{
22
    public function __construct()
23
    {
24
        parent::__construct('min', 'by', false);
25
    }
26
27
    protected function calcAbsoluteRatio($ratio)
28
    {
29
        return 1 + $ratio;
30
    }
31
32
    protected function isImageProcessable($ratio)
33
    {
34
        return $ratio > 1;
35
    }
36
}
37