Completed
Push — 2.0 ( 31dadf...addf4a )
by Stig
01:44
created

CropEntropy::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 8
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace Stojg\Crop;
4
5
class CropEntropy
6
{
7
    /**
8
     * @var \Imagick
9
     */
10
    protected $imagick = null;
11
12
    /**
13
     * CropEntropy constructor
14
     *
15
     * @param \Imagick|null $image
16
     */
17
    public function __construct(\Imagick $image = null)
18
    {
19
        if($image !== null) {
20
            $this->imagick = $image;
21
        } else {
22
            $this->imagick = new \Imagick();
23
        }
24
    }
25
26
    /**
27
     * @return \Imagick
28
     */
29
    public function getImagick()
30
    {
31
        return $this->imagick;
32
    }
33
}
34