InvalidProfileFormatException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 26
ccs 5
cts 5
cp 1
c 0
b 0
f 0
rs 10
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A make() 0 10 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arcanedev\Gravatar\Exceptions;
6
7
use InvalidArgumentException;
8
9
/**
10
 * Class     InvalidProfileFormatException
11
 *
12
 * @author   ARCANEDEV <[email protected]>
13
 */
14
class InvalidProfileFormatException extends InvalidArgumentException
15
{
16
    /* -----------------------------------------------------------------
17
     |  Main Methods
18
     | -----------------------------------------------------------------
19
     */
20
21
    /**
22
     * Make a new exception.
23
     *
24
     * @param  string  $format
25
     * @param  array   $supportedFormat
26
     *
27
     * @return \Arcanedev\Gravatar\Exceptions\InvalidProfileFormatException
28
     */
29 4
    public static function make(string $format, array $supportedFormat)
30
    {
31 4
        return new static(
32 4
            sprintf(
33 4
                'The format [%s] is invalid, the supported formats are: %s',
34
                $format,
35 4
                implode(', ', $supportedFormat)
36
            )
37
        );
38
    }
39
}
40