Completed
Push — master ( 3cd148...6fd5a8 )
by Freek
01:45 queued 14s
created

projectorDidNotWriteAnythingToSnapshot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Spatie\EventProjector\Exceptions;
4
5
use Exception;
6
use Spatie\EventProjector\Projectors\Projector;
7
8
class CouldNotCreateSnapshot extends Exception
9
{
10
    public static function projectorDidNotWriteAnythingToSnapshot(Projector $projector)
11
    {
12
        return new static("The projector named {$projector->getName()} didn't write to the snapshot. When snapshotting a projector should write it's state to the snapshot.");
13
    }
14
15
    public static function projectorThrewExceptionDuringWritingToSnapshot(Projector $projector, Exception $exception)
16
    {
17
        return new static("The projector named {$projector->getName()} threw an exception while writing to a snapshot", 0, $exception);
18
    }
19
}