Passed
Push — master ( 1b37b7...612acf )
by Tobias
01:49
created

FunctionNotSupportedException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getFunction() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Nyholm\Dsn\Exception;
6
7
/**
8
 * Thrown when the provided function is not supported.
9
 *
10
 * @author Tobias Nyholm <[email protected]>
11
 */
12
class FunctionNotSupportedException extends InvalidDsnException
13
{
14
    private $function;
15
16
    public function __construct(string $dsn, string $function, ?string $message = null)
17
    {
18
        parent::__construct($dsn, $message ?? sprintf('Function "%s" is not supported', $function));
19
        $this->function = $function;
20
    }
21
22
    public function getFunction(): string
23
    {
24
        return $this->function;
25
    }
26
}
27