Completed
Push — master ( b846df...63f83e )
by Freek
03:08
created

InvalidNewsletterList::noListsDefined()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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