Passed
Push — master ( e515a3...13e6ec )
by Vladimir
02:11
created

Scale   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfig() 0 9 2
1
<?php
2
/**
3
 * @link https://github.com/Vintage-web-production/yii2-tinify
4
 * @copyright Copyright (c) 2017 Vintage Web Production
5
 * @license BSD 3-Clause License
6
 */
7
8
namespace vintage\tinify\algorithms;
9
10
/**
11
 * Scale image algorithm.
12
 *
13
 * @author Vladimir Kuprienko <[email protected]>
14
 * @since 1.1
15
 */
16
class Scale extends AbstractAlgorithm
17
{
18
    /**
19
     * @inheritdoc
20
     */
21
    public function getConfig()
22
    {
23
        $config = [];
24
        if (!empty($this->width)) {
25
            $config['width'] = $this->width;
26
        } else {
27
            $config['height'] = $this->height;
28
        }
29
        return $config;
30
    }
31
}
32