Passed
Pull Request — main (#37)
by
unknown
03:01
created

SupportedFormats::getSupportedFormats()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 15
rs 9.9666
c 0
b 0
f 0
cc 3
nc 2
nop 1
1
<?php
2
3
namespace Conlect\ImageIIIF\Traits;
4
5
trait SupportedFormats
6
{
7
    public function getSupportedFormats(string $driver)
8
    {
9
        $formats = [
10
            'jpg',
11
            'png',
12
            'gif',
13
            'webp',
14
        ];
15
16
        if ($driver && $driver === 'imagick') {
17
            $formats[] = 'jp2';
18
            $formats[] = 'tif';
19
        }
20
21
        return $formats;
22
    }
23
}
24