ObjectNotFoundException::forClassAndIdentifier()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 8
nc 2
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Psi\Component\ObjectAgent\Exception;
6
7
class ObjectNotFoundException extends \RuntimeException
8
{
9
    public static function forClassAndIdentifier($class, $identifier)
10
    {
11
        if (null === $class) {
12
            return new static(sprintf(
13
                'Could not find object with identifier "%s"',
14
                $identifier
15
            ));
16
        }
17
18
        return new static(sprintf(
19
            'Could not find object of class "%s" with identifier "%s"',
20
            $class, $identifier
21
        ));
22
    }
23
}
24