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 ( f4ded9...a7fcfa )
by Joni
04:09
created

TargetName::fromChosenASN1()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 3
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 3
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace X509\Certificate\Extension\Target;
4
5
use ASN1\Type\Tagged\ExplicitlyTaggedType;
6
use ASN1\Type\TaggedType;
7
use X509\GeneralName\GeneralName;
8
9
10
/**
11
 * Implements 'targetName' CHOICE of the <i>Target</i> ASN.1 type.
12
 *
13
 * @link https://tools.ietf.org/html/rfc5755#section-4.3.2
14
 */
15 View Code Duplication
class TargetName extends Target
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
16
{
17
	/**
18
	 * Name.
19
	 *
20
	 * @var GeneralName $_name
21
	 */
22
	protected $_name;
23
	
24
	/**
25
	 * Constructor
26
	 *
27
	 * @param GeneralName $name
28
	 */
29 8
	public function __construct(GeneralName $name) {
30 8
		$this->_name = $name;
31 8
		$this->_type = self::TYPE_NAME;
32 8
	}
33
	
34 5
	public static function fromChosenASN1(TaggedType $el) {
35 5
		return new self(GeneralName::fromASN1($el));
36
	}
37
	
38 3
	public function string() {
39 3
		return $this->_name->string();
40
	}
41
	
42
	/**
43
	 * Get name.
44
	 *
45
	 * @return GeneralName
46
	 */
47 1
	public function name() {
48 1
		return $this->_name;
49
	}
50
	
51 6
	public function toASN1() {
52 6
		return new ExplicitlyTaggedType($this->_type, $this->_name->toASN1());
53
	}
54
}
55