LocalVolume1   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 14
ccs 7
cts 7
cp 1
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A hasDependencies() 0 3 1
A getMime() 0 7 2
1
<?php
2
3
namespace kalanis\kw_mime\Check;
4
5
6
use kalanis\kw_mime\MimeException;
7
use kalanis\kw_paths\PathsException;
8
9
10
/**
11
 * Class LocalVolume1
12
 * @package kalanis\kw_mime\Check
13
 * System library to detect the mime type on local volume
14
 */
15
class LocalVolume1 extends ALocalVolume
16
{
17 7
    protected function hasDependencies(): bool
18
    {
19 7
        return $this->isMimeMethod();
20
    }
21
22 5
    public function getMime(array $path): string
23
    {
24 5
        $this->checkMimeMethod();
25
        try {
26 5
            return $this->determineResult(mime_content_type($this->pathOnVolume($path)));
27 1
        } catch (PathsException $ex) {
28 1
            throw new MimeException($ex->getMessage(), $ex->getCode(), $ex);
29
        }
30
    }
31
}
32