InvalidConfiguration   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A notAnOptimizer() 0 6 1
A notAnLogger() 0 6 1
1
<?php
2
3
namespace Spatie\LaravelImageOptimizer\Exceptions;
4
5
use Exception;
6
use Psr\Log\LoggerInterface;
7
use Spatie\ImageOptimizer\Optimizer;
8
9
class InvalidConfiguration extends Exception
10
{
11
    public static function notAnOptimizer(string $class)
12
    {
13
        $optimizerInterface = Optimizer::class;
14
15
        return new static("Configured optimizer `{$class}` does not implement `{$optimizerInterface}`.");
16
    }
17
18
    public static function notAnLogger(string $class)
19
    {
20
        $loggerInterface = LoggerInterface::class;
21
22
        return new static("Configured optimizer `{$class}` does not implement `{$loggerInterface}`.");
23
    }
24
}
25