AbstractImageAdapter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 23
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 5 1
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
}