EntityNotFoundException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
eloc 7
c 1
b 0
f 1
dl 0
loc 11
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A translate() 0 7 1
1
<?php declare(strict_types=1);
2
3
namespace Audiens\AdForm\Exception;
4
5
/**
6
 * Exception thrown if an entity load returns an error
7
 */
8
class EntityNotFoundException extends SeverityAwareException
9
{
10
    protected const MESSAGE = 'Entity ID %d not found with message: %s';
11
12
    public static function translate($entityId, $message, $code): self
13
    {
14
        return new self (
15
            sprintf(self::MESSAGE, $entityId, $message),
16
            $code,
17
            null,
18
            SeverityAwareException::SEVERITY_ERROR
19
        );
20
    }
21
}
22