| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 12 | public function __construct($algorithm) |
|
| 19 | { |
||
| 20 | 12 | if (!in_array($algorithm, array(self::HASH_SHA1, self::HASH_SHA256, self::HASH_SHA512))) { |
|
| 21 | 1 | throw new \InvalidArgumentException( |
|
| 22 | 1 | $algorithm . ' is not supported, only sha1, sha256 and sha512 are allowed.' |
|
| 23 | ); |
||
| 24 | } |
||
| 25 | |||
| 26 | 11 | $this->algorithm = $algorithm; |
|
| 27 | 11 | } |
|
| 28 | |||
| 34 |