Completed
Push — v2 ( 3135e6...5d3e3a )
by Joschi
04:42 queued 10s
created

ItemObjectModel::alternates()   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
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 2
cp 0
crap 2
1
<?php
2
3
/**
4
 * micrometa
5
 *
6
 * @category Jkphl
7
 * @package Jkphl\Micrometa
8
 * @subpackage Jkphl\Micrometa\Ports\Item
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\Item;
38
39
use Jkphl\Micrometa\Ports\Rel\Alternate;
40
use Jkphl\Micrometa\Ports\Rel\AlternateInterface;
41
use Jkphl\Micrometa\Ports\Rel\Rel;
42
use Jkphl\Micrometa\Ports\Rel\RelInterface;
43
44
/**
45
 * Item object model
46
 *
47
 * @package Jkphl\Micrometa
48
 * @subpackage Jkphl\Micrometa\Ports
49
 */
50
class ItemObjectModel extends ItemList implements ItemObjectModelInterface
51
{
52
    /**
53
     * Return all rel=* declaration groups
54
     *
55
     * @return RelInterface[] Rel=* declaration groups
56
     * @api
57
     */
58
    public function rels()
59
    {
60
        return [];
61
    }
62
63
    /**
64
     * Return all rel declarations of a particular type
65
     *
66
     * @param string $rel Rel type
67
     * @param int|null $index Optional: particular index
68
     * @return RelInterface|RelInterface[] Single rel=* declaration or list of particular rel declarations
69
     * @api
70
     */
71
    public function rel($rel, $index = null)
72
    {
73
        return new Rel();
74
    }
75
76
    /**
77
     * Return all alternate resources
78
     *
79
     * @return AlternateInterface[] Alternate resources
80
     * @api
81
     */
82
    public function alternates()
83
    {
84
        return [];
85
    }
86
87
    /**
88
     * Return the alternate resource of a particular type
89
     *
90
     * @param string $type Alternate representation type
91
     * @return AlternateInterface|null Alternate resource
92
     * @api
93
     */
94
    public function alternate($type)
95
    {
96
        return new Alternate();
97
    }
98
}
99