UrlRewriteRegenerationFailed   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 17
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A noConfiguration() 0 4 1
A invalidType() 0 4 1
A columnNotSet() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace RuthgerIdema\UrlRewrite\Exceptions;
6
7
use Exception;
8
9
class UrlRewriteRegenerationFailed extends Exception
10
{
11
    public static function noConfiguration(): self
12
    {
13
        return new static('No types are set in the configuration.');
14
    }
15
16
    public static function invalidType($type): self
17
    {
18
        return new static("Type `{$type}` does not exist.");
19
    }
20
21
    public static function columnNotSet($urlRewrite, $column): self
22
    {
23
        return new static("Url rewrite with id `{$urlRewrite->id}` has no `{$column}`");
24
    }
25
}
26