InvalidNewsletterList::noListWithName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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