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

Font   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 46.67%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 53
ccs 7
cts 15
cp 0.4667
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A setFile() 0 4 1
A getFile() 0 4 1
A setName() 0 4 1
A getName() 0 4 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