Font::getFile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace SixtyNine\Cloud\Model;
4
use Webmozart\Assert\Assert;
5
6
/**
7
 * Embed a TTF font in the Cloud system.
8
 */
9
class Font
10
{
11
    /** @var string */
12
    protected $name;
13
14
    /** @var string */
15
    protected $file;
16
17
    /**
18
     * Create a TTF font from the given $file.
19
     * @param string $name
20
     * @param string $file
21
     * @throws \InvalidArgumentException
22
     */
23 13
    public function __construct($name, $file)
24
    {
25 13
        Assert::fileExists($file, "File not found $file");
26 13
        $this->name = $name;
27 13
        $this->file = $file;
28 13
    }
29
30
    /**
31
     * @param string $file
32
     */
33
    public function setFile($file)
34
    {
35
        $this->file = $file;
36
    }
37
38
    /**
39
     * @return string
40
     */
41 13
    public function getFile()
42
    {
43 13
        return $this->file;
44
    }
45
46
    /**
47
     * @param string $name
48
     */
49
    public function setName($name)
50
    {
51
        $this->name = $name;
52
    }
53
54
    /**
55
     * @return string
56
     */
57
    public function getName()
58
    {
59
        return $this->name;
60
    }
61
}
62