Single::getType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
/**
4
 * This file is part of the Tuple package.
5
 * For the full copyright information please view the LICENCE file that was
6
 * distributed with this package.
7
 *
8
 * @copyright Simon Deeley 2017
9
 */
10
11
namespace simondeeley\Tuples;
12
13
use simondeeley\Tuple;
14
15
/**
16
 * Concrete implementaion of a single tuple
17
 *
18
 * In use, this class allows you to create a mathematical single which in PHP
19
 * terms is an object containing exactly one item. This item can be of any
20
 * type. Construction in through the 'new' keyword, e.g.
21
 * $single = new Single('foo'); Once instantiated, access to the objects
22
 * properties are via an array-type access, such as $value = $single[0];
23
 * Trying to set values this way will result in an exception being thrown.
24
 *
25
 * @final
26
 * @author Simon Deeley <[email protected]>
27
 */
28
final class Single extends Tuple
29
{
30
    const MAX_LENGTH = 1;
31
    const MIN_LENGTH = 1;
32
33
    /**
34
     * Return type of this object
35
     *
36
     * @see simondeeley\Type
37
     * @return string
38
     */
39 5
    final public static function getType(): string
0 ignored issues
show
Coding Style introduced by
Unnecessary FINAL modifier in FINAL class
Loading history...
40
    {
41 5
        return 'SINGLE';
42
    }
43
}
44