GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( c430e2...993294 )
by Nicholas
03:11
created

TransformationFormat::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 8
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
namespace UCD\Unicode;
4
5
use UCD\Exception\InvalidArgumentException;
6
7
final class TransformationFormat
8
{
9
    const EIGHT = '8NE';
10
    const SIXTEEN = '16NE';
11
    const SIXTEEN_BIG_ENDIAN = '16BE';
12
    const SIXTEEN_LITTLE_ENDIAN = '16LE';
13
    const THIRTY_TWO = '32NE';
14
    const THIRTY_TWO_BIG_ENDIAN = '32BE';
15
    const THIRTY_TWO_LITTLE_ENDIAN = '32LE';
16
17
    /**
18
     * @var string[]
19
     */
20
    private static $valid = [
21
        self::EIGHT,
22
        self::SIXTEEN,
23
        self::SIXTEEN_BIG_ENDIAN,
24
        self::SIXTEEN_LITTLE_ENDIAN,
25
        self::THIRTY_TWO,
26
        self::THIRTY_TWO_BIG_ENDIAN,
27
        self::THIRTY_TWO_LITTLE_ENDIAN
28
    ];
29
30
    /**
31
     * @var string
32
     */
33
    private $type;
34
35
    /**
36
     * @param string $type
37
     * @throws InvalidArgumentException
38
     */
39
    private function __construct($type)
40
    {
41
        if (!in_array($type, self::$valid)) {
42
            throw new InvalidArgumentException();
43
        }
44
45
        $this->type = $type;
46
    }
47
48
    /**
49
     * @param string $type
50
     * @return TransformationFormat
51
     */
52
    public static function ofType($type)
53
    {
54
        return new self($type);
55
    }
56
57
    /**
58
     * @return string
59
     */
60
    public function getType()
61
    {
62
        return $this->type;
63
    }
64
}