LocalVolume1::hasDependencies()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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