SitemapException   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 6
c 2
b 0
f 0
dl 0
loc 25
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A forPriority() 0 3 1
A forEmptyPath() 0 3 1
A forEmptyUrl() 0 3 1
A forNotExistingChangeFrequency() 0 3 1
A forNotExistingSitemapProvider() 0 3 1
1
<?php
2
3
namespace JeroenDesloovere\SitemapBundle\Exception;
4
5
class SitemapException extends \Exception
6
{
7
    public static function forEmptyPath(): self
8
    {
9
        return new self('The path you have given is empty.');
10
    }
11
12
    public static function forEmptyUrl(): self
13
    {
14
        return new self('The url you have given is empty.');
15
    }
16
17
    public static function forNotExistingChangeFrequency(string $changeFrequency): self
18
    {
19
        return new self('The given changeFrequency "' . $changeFrequency . '" does not exist.');
20
    }
21
22
    public static function forNotExistingSitemapProvider($sitemapProviderKey): self
23
    {
24
        return new self('The requested sitemap provider with key "' . $sitemapProviderKey . '" does not exist.');
25
    }
26
27
    public static function forPriority(): self
28
    {
29
        return new self('Priority must be a value between 0 and 10.');
30
    }
31
}
32