Completed
Pull Request — master (#6)
by Dan
07:19
created

Font::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
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 11
    function __construct($name, $file)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
24
    {
25 11
        Assert::fileExists($file, "File not found $file");
26 11
        $this->name = $name;
27 11
        $this->file = $file;
28 11
    }
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 10
    public function getFile()
42
    {
43 10
        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