AbstractImageAdapter::init()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace tkanstantsin\fileupload\formatter\adapter;
5
6
use Imagine\Image\ImagineInterface;
7
use tkanstantsin\fileupload\formatter\ImagineFactory;
8
use tkanstantsin\fileupload\model\BaseObject;
9
10
abstract class AbstractImageAdapter extends BaseObject implements IFormatAdapter
11
{
12
    /**
13
     * @see ImagineFactory::get()
14
     * @var string
15
     */
16
    public $driver = ImagineFactory::DEFAULT_DRIVER;
17
18
    /**
19
     * @var ImagineInterface
20
     */
21
    protected $imagine;
22
23
    /**
24
     * @inheritdoc
25
     * @throws \Imagine\Exception\RuntimeException
26
     * @throws \tkanstantsin\fileupload\config\InvalidConfigException
27
     */
28
    public function init(): void
29
    {
30
        parent::init();
31
32
        $this->imagine = ImagineFactory::get($this->driver);
33
    }
34
35
}