Completed
Push — master ( edf7d0...ba16ca )
by Tony Karavasilev (Тони
19:42
created

getKeyExpansionFunction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * Trait implementation of the setter dependency injection type for key expansion digestion services.
5
 */
6
7
namespace CryptoManana\Core\Traits\Containers;
8
9
use \CryptoManana\Core\Abstractions\MessageDigestion\AbstractKeyMaterialDerivationFunction as KeyDerivationFunction;
10
use \CryptoManana\Core\Interfaces\Containers\KeyExpansionInjectableInterface as KeyExpansionSpecification;
11
12
/**
13
 * Trait KeyExpansionInjectableTrait - Reusable implementation of `KeyExpansionInjectableInterface`.
14
 *
15
 * @see \CryptoManana\Core\Interfaces\Containers\KeyExpansionInjectableInterface The abstract specification.
16
 *
17
 * @package CryptoManana\Core\Traits\Containers
18
 *
19
 * @property KeyDerivationFunction|null $keyExpansionSource The message key expansion derivation service.
20
 *
21
 * @mixin KeyExpansionSpecification
22
 */
23
trait KeyExpansionInjectableTrait
24
{
25
    /**
26
     * Setter for the key expansion derivation service.
27
     *
28
     * @param KeyDerivationFunction $hasher The key expansion derivation service or null.
29
     *
30
     * @return $this The container object.
31
     */
32 4
    public function setKeyExpansionFunction(KeyDerivationFunction $hasher)
33
    {
34 4
        $this->keyExpansionSource = $hasher;
35
36 4
        return $this;
37
    }
38
39
    /**
40
     * Getter for the key expansion derivation service.
41
     *
42
     * @return KeyDerivationFunction|null The currently injected key expansion derivation service or null.
43
     */
44 4
    public function getKeyExpansionFunction()
45
    {
46 4
        return $this->keyExpansionSource;
47
    }
48
}
49