ObjectNotFoundException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A forClassAndIdentifier() 0 14 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