RawConstructed::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 8
ccs 0
cts 6
cp 0
rs 10
cc 1
nc 1
nop 4
crap 2
1
<?php
2
3
namespace Ocsp\Asn1\Element;
4
5
use Ocsp\Asn1\TaggableElementTrait;
6
7
/**
8
 * An un-decoded ASN.1 CONSTRUCTED element.
9
 */
10
class RawConstructed extends AbstractList
11
{
12
    use TaggableElementTrait;
13
14
    /**
15
     * The handle of the encoding.
16
     *
17
     * @var string
18
     */
19
    private $encoding;
20
21
    /**
22
     * The decoded type ID.
23
     *
24
     * @var int|string|\phpseclib\Math\BigInteger|\phpseclib3\Math\BigInteger
0 ignored issues
show
Bug introduced by
The type phpseclib\Math\BigInteger was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
25
     */
26
    private $typeID;
27
28
    /**
29
     * The class (the value of one of the Element::CLASS_... constants).
30
     *
31
     * @var string
32
     */
33
    private $class;
34
35
    /**
36
     * Create a new instance.
37
     *
38
     * @param string $encoding the handle of the encoding
39
     * @param int|string|\phpseclib\Math\BigInteger|\phpseclib3\Math\BigInteger $typeID
40
     * @param string $class the class (the value of one of the Element::CLASS_... constants)
41
     * @param \Ocsp\Asn1\Element[] $elements
42
     *
43
     * @return static
44
     */
45
    public static function create($encoding, $typeID, $class, array $elements = [])
46
    {
47
        $result = new static();
48
        $result->encoding = $encoding;
49
        $result->typeID = $typeID;
50
        $result->class = $class;
51
52
        return $result->addElements($elements);
53
    }
54
55
    /**
56
     * {@inheritdoc}
57
     *
58
     * @see \Ocsp\Asn1\Element::getClass()
59
     */
60
    public function getClass()
61
    {
62
        return $this->class;
63
    }
64
65
    /**
66
     * {@inheritdoc}
67
     *
68
     * @see \Ocsp\Asn1\Element::getTypeID()
69
     */
70
    public function getTypeID()
71
    {
72
        return $this->typeID;
73
    }
74
75
    /**
76
     * {@inheritdoc}
77
     *
78
     * @see \Ocsp\Asn1\Element::isConstructed()
79
     */
80
    public function isConstructed()
81
    {
82
        return true;
83
    }
84
}
85