Pair::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 pair tuple
17
 *
18
 * In use, this class allows you to create a mathematical pair which in PHP
19
 * terms is an object containing exactly two items. These items can be of any
20
 * type. Construction in through the 'new' keyword, e.g. $pair = new Pair(1, 2);
21
 * Once instantiated, access to the objects properties are via an array-type
22
 * access, such as $value = $pair[1]; Trying to set values this way will result
23
 * in an exception being thrown.
24
 *
25
 * @final
26
 * @author Simon Deeley <[email protected]>
27
 */
28
final class Pair extends Tuple
29
{
30
    const MAX_LENGTH = 2;
31
    const MIN_LENGTH = 2;
32
33
    /**
34
     * Return type of this object
35
     *
36
     * @see simondeeley\Type
37
     * @return string
38
     */
39 7
    final public static function getType(): string
0 ignored issues
show
Coding Style introduced by
Unnecessary FINAL modifier in FINAL class
Loading history...
40
    {
41 7
        return 'PAIR';
42
    }
43
}
44