GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 803145...65bdb2 )
by Alex
02:52
created

FileAttachment::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/**
4
 * Created by PhpStorm.
5
 * User: alex
6
 * Date: 13.12.16
7
 * Time: 21:22
8
 */
9
namespace Conversio\Mail\Attachment\Persistence;
10
11
use Conversio\Mail\Attachment\AttachmentInterface;
12
use League\Flysystem\File;
13
14
class FileAttachment implements AttachmentInterface
15
{
16
    /**
17
     * @var File
18
     */
19
    private $file;
20
21
    public function __construct(File $file)
22
    {
23
        $this->file = $file;
24
    }
25
26
    public function getMimeType(): string
27
    {
28
        return $this->file->getMimetype();
29
    }
30
31
    public function getContent(): string
32
    {
33
        return $this->file->read();
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function getName(): string
40
    {
41
        return $this->file->getPath();
42
    }
43
44
    public function getExtension(): string
45
    {
46
        return basename($this->file->getPath());
47
    }
48
49
    public function getFullname(): string
50
    {
51
        return $this->getName() . '.' . $this->getExtension();
52
    }
53
54
}