Passed
Pull Request — master (#60)
by Tim
02:20
created

DigestValueTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 12
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A validDigestValue() 0 6 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\XMLSecurity\Assert;
6
7
use InvalidArgumentException;
8
9
/**
10
 * @package simplesamlphp/xml-security
11
 */
12
trait DigestValueTrait
13
{
14
    /**
15
     * @param string $value
16
     * @param string $message
17
     */
18
    protected static function validDigestValue(string $value, string $message = ''): void
19
    {
20
        parent::validBase64Binary(
21
            $value,
22
            $message ?: '%s is not a valid xs:DigestValue',
23
            InvalidArgumentException::class,
24
        );
25
    }
26
}
27