Completed
Push — master ( 9b124d...317457 )
by Jasper
03:01
created

File::getMimeType()   A

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 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Swis\Laravel\Encrypted;
4
5
use League\Flysystem\Util;
6
use Symfony\Component\HttpFoundation\File\File as BaseFile;
7
8
class File extends BaseFile
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13 12
    public function getMimeType()
14
    {
15 12
        return Util::guessMimeType($this->getPathname(), $this->getContents());
16
    }
17
18
    /**
19
     * {@inheritdoc}
20
     */
21 30
    public function getSize()
22
    {
23 30
        return \strlen($this->getContents());
24
    }
25
26
    /**
27
     * @return string
28
     */
29 48
    public function getContents(): string
30
    {
31 48
        return decrypt(\file_get_contents($this->getPathname()));
32
    }
33
}
34