Completed
Push — master ( 1789bd...153a0b )
by Freek
01:51 queued 10s
created

CampaignCouldNotUpdate   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 12
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A beingSent() 0 4 1
A alreadySent() 0 4 1
1
<?php
2
3
namespace Spatie\EmailCampaigns\Exceptions;
4
5
use Exception;
6
use Spatie\EmailCampaigns\Models\Campaign;
7
8
class CampaignCouldNotUpdate extends Exception
9
{
10
    public static function beingSent(Campaign $campaign): self
11
    {
12
        return new static("The campaign `{$campaign->name}` cannot be updated because it is being sent.");
13
    }
14
15
    public static function alreadySent(Campaign $campaign): self
16
    {
17
        return new static("The campaign `{$campaign->name}` cannot be updated because it was already sent.");
18
    }
19
}
20