InvalidNewsletterList   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A noListsDefined() 0 4 1
A noListWithName() 0 4 1
A defaultListDoesNotExist() 0 4 1
1
<?php
2
3
namespace Spatie\Newsletter\Exceptions;
4
5
use Exception;
6
7
class InvalidNewsletterList extends Exception
8
{
9
    /**
10
     * @return static
11
     */
12
    public static function noListsDefined()
13
    {
14
        return new static('There are no lists defined.');
15
    }
16
17
    /**
18
     * @param string $name
19
     *
20
     * @return static
21
     */
22
    public static function noListWithName($name)
23
    {
24
        return new static("There is no list named `{$name}`.");
25
    }
26
27
    /**
28
     * @param $defaultListName
29
     *
30
     * @return static
31
     */
32
    public static function defaultListDoesNotExist($defaultListName)
33
    {
34
        return new static("Could not find a default list named `{$defaultListName}`.");
35
    }
36
}
37