Completed
Push — v2 ( b3c0e1...e198fb )
by Joschi
08:19
created

Alternate   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 49
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getType() 0 4 1
A getTitle() 0 4 1
1
<?php
2
3
/**
4
 * micrometa
5
 *
6
 * @category Jkphl
7
 * @package Jkphl\Micrometa
8
 * @subpackage Jkphl\Micrometa\Ports\Rel
9
 * @author Joschi Kuphal <[email protected]> / @jkphl
10
 * @copyright Copyright © 2017 Joschi Kuphal <[email protected]> / @jkphl
11
 * @license http://opensource.org/licenses/MIT The MIT License (MIT)
12
 */
13
14
/***********************************************************************************
15
 *  The MIT License (MIT)
16
 *
17
 *  Copyright © 2017 Joschi Kuphal <[email protected]> / @jkphl
18
 *
19
 *  Permission is hereby granted, free of charge, to any person obtaining a copy of
20
 *  this software and associated documentation files (the "Software"), to deal in
21
 *  the Software without restriction, including without limitation the rights to
22
 *  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
23
 *  the Software, and to permit persons to whom the Software is furnished to do so,
24
 *  subject to the following conditions:
25
 *
26
 *  The above copyright notice and this permission notice shall be included in all
27
 *  copies or substantial portions of the Software.
28
 *
29
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
 *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
31
 *  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
32
 *  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
33
 *  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
34
 *  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35
 ***********************************************************************************/
36
37
namespace Jkphl\Micrometa\Ports\Rel;
38
39
/**
40
 * Alternate resource
41
 *
42
 * @package Jkphl\Micrometa
43
 * @subpackage Jkphl\Micrometa\Ports
44
 */
45
class Alternate extends Rel implements AlternateInterface
46
{
47
    /**
48
     * Alternate resource type
49
     *
50
     * @var string
51
     */
52
    protected $type;
53
    /**
54
     * Alternate resource title
55
     *
56
     * @var string
57
     */
58
    protected $title;
59
60
    /**
61
     * Alternate resource constructor
62
     *
63
     * @param string $value Alternate resource URL
64
     * @param string $type Alternate resource type
65
     * @param string $title Alternate resource title
66
     */
67 4
    public function __construct($value, $type, $title)
68
    {
69 4
        parent::__construct($value);
70 4
        $this->type = $type;
71 4
        $this->title = $title;
72 4
    }
73
74
    /**
75
     * Return the alternate resource type
76
     *
77
     * @return string Alternate resource type
78
     */
79 1
    public function getType()
80
    {
81 1
        return $this->type;
82
    }
83
84
    /**
85
     * Alternate resource title
86
     *
87
     * @return string Alternate resource title
88
     */
89 1
    public function getTitle()
90
    {
91 1
        return $this->title;
92
    }
93
}
94