Completed
Push — master ( 48985c...642fe5 )
by Jasper
12:59 queued 09:23
created

File   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getSize() 0 3 1
A getMimeType() 0 3 1
A getContents() 0 3 1
1
<?php
2
3
namespace Swis\Filesystem\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