Total Complexity | 3 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | trait DerivationContextTrait |
||
23 | { |
||
24 | /** |
||
25 | * Setter for the derivation context/application information string property. |
||
26 | * |
||
27 | * @param string $contextualString The derivation context/application information string. |
||
28 | * |
||
29 | * @return $this The hash algorithm object. |
||
30 | * @throws \Exception Validation errors. |
||
31 | */ |
||
32 | 41 | public function setContextualString($contextualString) |
|
33 | { |
||
34 | 41 | if (!is_string($contextualString)) { |
|
35 | 15 | throw new \InvalidArgumentException('The context information string must be of type string.'); |
|
36 | } |
||
37 | |||
38 | 26 | $this->contextualString = $contextualString; |
|
39 | |||
40 | 26 | return $this; |
|
41 | } |
||
42 | |||
43 | /** |
||
44 | * Getter for the derivation context/application information string property. |
||
45 | * |
||
46 | * @return string The derivation context/application information string. |
||
47 | */ |
||
48 | 15 | public function getContextualString() |
|
51 | } |
||
52 | } |
||
53 |