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

FunctionNotSupportedException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 2
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
nc 1
nop 3
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