Passed
Pull Request — main (#22)
by
unknown
04:14 queued 02:11
created

supportedFormats   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSupportedFormats() 0 15 3
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