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

UnitOfWorkException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
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