Test Failed
Push — master ( 34c614...ede9b5 )
by Dawid
05:49
created

UnitOfWorkException::forPersistingEntityInInvalidState()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php declare(strict_types=1);
2
3
namespace Igni\Storage\Exception;
4
5
class UnitOfWorkException extends StorageException
6
{
7
    public static function forPersistingEntityInInvalidState($entity): UnitOfWorkException
8
    {
9
        $entity = get_class($entity);
10
        return new self("Cannot persist entity {$entity} which is in detached or removed state");
11
    }
12
}
13