PBES1PKCS5AlgorithmIdentifier   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 16
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Sop\PKCS5\ASN1\AlgorithmIdentifier;
6
7
/**
8
 * Base class for PBES1 encryption scheme with PKCS #5 semantics.
9
 */
10
abstract class PBES1PKCS5AlgorithmIdentifier extends PBES1AlgorithmIdentifier
11
{
12
    /**
13
     * Constructor.
14
     *
15
     * @param string $salt            Salt
16
     * @param int    $iteration_count Iteration count
17
     *
18
     * @throws \UnexpectedValueException
19
     */
20 14
    public function __construct(string $salt, int $iteration_count)
21
    {
22 14
        if (8 !== strlen($salt)) {
23 1
            throw new \UnexpectedValueException('Salt length must be 8 octets.');
24
        }
25 13
        parent::__construct($salt, $iteration_count);
26 13
    }
27
}
28