InvalidProfileFormatException::make()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 10
ccs 5
cts 5
cp 1
crap 1
rs 9.9332
c 0
b 0
f 0
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