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.
Passed
Branch php72 (57c34e)
by Joni
05:01
created

UTF8String   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 21
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A _validateString() 0 3 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Sop\ASN1\Type\Primitive;
6
7
use Sop\ASN1\Type\PrimitiveString;
8
use Sop\ASN1\Type\UniversalClass;
9
10
/**
11
 * Implements <i>UTF8String</i> type.
12
 *
13
 * UTF8String is an Unicode string with UTF-8 encoding.
14
 */
15
class UTF8String extends PrimitiveString
16
{
17
    use UniversalClass;
18
19
    /**
20
     * Constructor.
21
     *
22
     * @param string $string
23
     */
24 6
    public function __construct(string $string)
25
    {
26 6
        $this->_typeTag = self::TYPE_UTF8_STRING;
27 6
        parent::__construct($string);
28 4
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33 6
    protected function _validateString(string $string): bool
34
    {
35 6
        return mb_check_encoding($string, 'UTF-8');
36
    }
37
}
38