InvalidConfiguration   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A invalidCredential() 0 3 1
A driverNotFound() 0 3 1
1
<?php
2
3
4
namespace DansMaCulotte\MailTemplate\Exceptions;
5
6
use Exception;
7
use Throwable;
8
9
/**
10
 * Class InvalidConfiguration
11
 * @package DansMaCulotte\MailTemplate\Exceptions
12
 */
13
class InvalidConfiguration extends Exception
14
{
15
    /**
16
     * @param string $name
17
     * @param string $key
18
     * @param int $code
19
     * @param Throwable|null $previous
20
     * @return InvalidConfiguration
21
     */
22
    public static function invalidCredential($name, $key, $code = 0, Throwable $previous = null)
23
    {
24
        return new static("Credential `{$key}` for `{$name}` is invalid.", $code, $previous);
25
    }
26
27
    /**
28
     * @param $name
29
     * @return InvalidConfiguration
30
     */
31
    public static function driverNotFound($name)
32
    {
33
        return new static("Driver {$name} not found.");
34
    }
35
}
36