mlocati /
ocsp
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Ocsp\Asn1\Element; |
||
| 4 | |||
| 5 | use Ocsp\Asn1\Encoder; |
||
| 6 | use Ocsp\Asn1\TaggableElement; |
||
| 7 | use Ocsp\Asn1\TaggableElementTrait; |
||
| 8 | use Ocsp\Exception\Asn1EncodingException; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * An un-decoded ASN.1 PRIMITIVE element. |
||
| 12 | */ |
||
| 13 | class RawPrimitive implements TaggableElement |
||
| 14 | { |
||
| 15 | use TaggableElementTrait; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * The handle of the encoding. |
||
| 19 | * |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | private $encoding; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * The decoded type ID. |
||
| 26 | * |
||
| 27 | * @var int|string|\phpseclib\Math\BigInteger|\phpseclib3\Math\BigInteger |
||
|
0 ignored issues
–
show
|
|||
| 28 | */ |
||
| 29 | private $typeID; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * The class (the value of one of the Element::CLASS_... constants). |
||
| 33 | * |
||
| 34 | * @var string |
||
| 35 | */ |
||
| 36 | private $class; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * The not decoded bytes representing the value. |
||
| 40 | * |
||
| 41 | * @var string |
||
| 42 | */ |
||
| 43 | private $rawEncodedValue; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Create a new instance. |
||
| 47 | * |
||
| 48 | * @param string $encoding the handle of the encoding |
||
| 49 | * @param int|string|\phpseclib\Math\BigInteger|\phpseclib3\Math\BigInteger $typeID |
||
| 50 | * @param string $class the class (the value of one of the Element::CLASS_... constants) |
||
| 51 | * @param string $rawEncodedValue the not decoded bytes representing the value |
||
| 52 | * |
||
| 53 | * @return static |
||
| 54 | */ |
||
| 55 | 3 | public static function create($encoding, $typeID, $class, $rawEncodedValue) |
|
| 56 | { |
||
| 57 | 3 | $result = new static(); |
|
| 58 | 3 | $result->encoding = $encoding; |
|
| 59 | 3 | $result->typeID = $typeID; |
|
| 60 | 3 | $result->class = $class; |
|
| 61 | 3 | $result->rawEncodedValue = $rawEncodedValue; |
|
| 62 | |||
| 63 | 3 | return $result; |
|
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * {@inheritdoc} |
||
| 68 | * |
||
| 69 | * @see \Ocsp\Asn1\Element::getClass() |
||
| 70 | */ |
||
| 71 | 3 | public function getClass() |
|
| 72 | { |
||
| 73 | 3 | return $this->class; |
|
| 74 | } |
||
| 75 | |||
| 76 | /** |
||
| 77 | * {@inheritdoc} |
||
| 78 | * |
||
| 79 | * @see \Ocsp\Asn1\Element::getTypeID() |
||
| 80 | */ |
||
| 81 | 3 | public function getTypeID() |
|
| 82 | { |
||
| 83 | 3 | return $this->typeID; |
|
| 84 | } |
||
| 85 | |||
| 86 | /** |
||
| 87 | * {@inheritdoc} |
||
| 88 | * |
||
| 89 | * @see \Ocsp\Asn1\Element::isConstructed() |
||
| 90 | */ |
||
| 91 | public function isConstructed() |
||
| 92 | { |
||
| 93 | return false; |
||
| 94 | } |
||
| 95 | |||
| 96 | /** |
||
| 97 | * Get the not decoded bytes representing the value. |
||
| 98 | * |
||
| 99 | * @return string |
||
| 100 | */ |
||
| 101 | 3 | public function getRawEncodedValue() |
|
| 102 | { |
||
| 103 | 3 | return $this->rawEncodedValue; |
|
| 104 | } |
||
| 105 | |||
| 106 | /** |
||
| 107 | * {@inheritdoc} |
||
| 108 | * |
||
| 109 | * @see \Ocsp\Asn1\Element::getEncodedValue() |
||
| 110 | */ |
||
| 111 | public function getEncodedValue(Encoder $encoder) |
||
| 112 | { |
||
| 113 | if ($encoder->getEncodingHandle() === $this->encoding) { |
||
| 114 | return $this->rawEncodedValue; |
||
| 115 | } |
||
| 116 | throw Asn1EncodingException::create('Unable to decode/encode an ASN.1 element'); |
||
| 117 | } |
||
| 118 | } |
||
| 119 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths