Completed
Pull Request — master (#25)
by Bradley
05:48
created

ExpiredInviteCode   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A forInvite() 0 7 1
1
<?php
2
3
namespace Clarkeash\Doorman\Exceptions;
4
5
use Clarkeash\Doorman\Models\Invite;
6
7
class ExpiredInviteCode extends DoormanException
8
{
9
    const DATE_FORMAT = 'Y-m-d H:i';
10
11
    public static function forInvite(Invite $invite): ExpiredInviteCode
12
    {
13
        return new self(trans('doorman::messages.expired', [
14
            'code' => $invite->code,
15
            'expired' => $invite->expires()->format(self::DATE_FORMAT),
16
        ]));
17
    }
18
}
19