Completed
Pull Request — master (#5)
by Dan
04:20
created

Font::setName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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