Completed
Push — master ( da4b66...3ae217 )
by Tim
19s queued 15s
created

VersionMismatchException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 7
c 0
b 0
f 0
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML11\Exception;
6
7
/**
8
 * This exception may be raised when a message with a wrong version is received.
9
 *
10
 * @package simplesamlphp/saml11
11
 */
12
class VersionMismatchException extends RuntimeException
13
{
14
    /**
15
     * @param string $message
16
     */
17
    public function __construct(string $message = '')
18
    {
19
        if ($message === '') {
20
            if (defined('static::DEFAULT_MESSAGE')) {
21
                $message = static::DEFAULT_MESSAGE;
1 ignored issue
show
Bug introduced by
The constant SimpleSAML\SAML11\Except...eption::DEFAULT_MESSAGE was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
22
            } else {
23
                $message = 'A message with the wrong version was received.';
24
            }
25
        }
26
27
        parent::__construct($message);
28
    }
29
}
30