InvalidStatusException::withStatus()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace SumoCoders\FrameworkMultiUserBundle\Exception;
4
5
use Exception;
6
use SumoCoders\FrameworkMultiUserBundle\ValueObject\Status;
7
8
final class InvalidStatusException extends Exception
9
{
10
    public static function withStatus(string $status): self
11
    {
12
        return new self(
13
            sprintf(
14
                'Invalid status %s, possible statuses are: %s.',
15
                $status,
16
                implode(', ', Status::getPossibleStatuses())
17
            )
18
        );
19
    }
20
}
21