LocalVolume1::getMime()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 7
ccs 5
cts 5
cp 1
crap 2
rs 10
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