Icon::getHref()   A
last analyzed

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 0
1
<?php
2
/**
3
     * Created by PhpStorm.
4
     * User: Matthew
5
     * Date: 15/07/15
6
     * Time: 4:20 PM
7
     */
8
9
namespace Mpclarkson\IconScraper;
10
11
class Icon
12
{
13
    const APPLE_TOUCH = 'apple-touch-icon';
14
    const FAVICON = 'favicon';
15
16
    /**
17
     * @var string
18
     */
19
    private $type;
20
21
    /**
22
     * @var string
23
     */
24
    private $href;
25
26
    /**
27
     * @var array
28
     */
29
    private $size;
30
31
    public function __construct($type, $href, array $size)
32
    {
33
        $this->type = $type;
34
        $this->href = $href;
35
        $this->size = $size;
36
    }
37
38
    public function getType()
39
    {
40
        return $this->type;
41
    }
42
43
    public function getHref()
44
    {
45
        return $this->href;
46
    }
47
48
    public function getSize()
49
    {
50
        return $this->size;
51
    }
52
53
    public function getWidth()
54
    {
55
        return array_key_exists(0, $this->size) ? $this->size[0] : null;
56
    }
57
58
    public function getHeight()
59
    {
60
        return array_key_exists(1, $this->size) ? $this->size[1] : null;
61
    }
62
}