ThumbConfig   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 45
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getInstance() 0 4 1
1
<?php
2
/**
3
 * Licensed under the Apache License, Version 2.0 (the "License");
4
 * you may not use this file except in compliance with the License.
5
 * You may obtain a copy of the License at
6
 *
7
 * @license http://www.apache.org/licenses/LICENSE-2.0
8
 *
9
 * Unless required by applicable law or agreed to in writing, software
10
 * distributed under the License is distributed on an "AS IS" BASIS,
11
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 * See the License for the specific language governing permissions and
13
 * limitations under the License.
14
 *
15
 * @author Alexander Zakharov <[email protected]>
16
 * @link http://rootlocal.ru
17
 * @copyright Copyright © 2018 rootlocal.ru
18
 */
19
20
namespace image\components;
21
22
use yii\base\BaseObject;
23
24
/**
25
 * Class ThumbConfig
26
 * @package image\components
27
 */
28
class ThumbConfig extends BaseObject
29
{
30
    /**
31
     * @var int
32
     */
33
    public $width = 100;
34
35
    /**
36
     * @var int
37
     */
38
    public $height = 100;
39
40
    /**
41
     * @var bool
42
     */
43
    public $crop = false;
44
45
    /**
46
     * @var bool
47
     */
48
    public $watermark = false;
49
50
    /**
51
     * @var integer
52
     */
53
    public $watermarkOpacity = 25;
54
55
    /**
56
     * @var int
57
     */
58
    public $quality = 100;
59
60
    /**
61
     * @var ThumbConfig
62
     */
63
    private static $_instance;
64
65
    /**
66
     * @param array $config
67
     * @return ThumbConfig
68
     */
69
    public static function getInstance(array $config = [])
70
    {
71
        self::$_instance = new self($config);
72
        return self::$_instance;
73
    }
74
75
}