Image::requirementsAreInstalled()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Spatie\MediaLibrary\ImageGenerators\FileTypes;
4
5
use Illuminate\Support\Collection;
6
use Spatie\MediaLibrary\Conversion\Conversion;
7
use Spatie\MediaLibrary\ImageGenerators\BaseGenerator;
8
9
class Image extends BaseGenerator
10
{
11
    public function convert(string $path, Conversion $conversion = null): string
12
    {
13
        return $path;
14
    }
15
16
    public function requirementsAreInstalled(): bool
17
    {
18
        return true;
19
    }
20
21
    public function supportedExtensions(): Collection
22
    {
23
        return collect(['png', 'jpg', 'jpeg', 'gif']);
24
    }
25
26
    public function supportedMimeTypes(): Collection
27
    {
28
        return collect(['image/jpeg', 'image/gif', 'image/png']);
29
    }
30
}
31