@@ -2,15 +2,15 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\EventProjector\Models; |
4 | 4 | |
5 | -use Exception; |
|
6 | 5 | use Carbon\Carbon; |
7 | -use Illuminate\Database\Eloquent\Model; |
|
6 | +use Exception; |
|
8 | 7 | use Illuminate\Database\Eloquent\Builder; |
9 | -use Spatie\EventProjector\ShouldBeStored; |
|
8 | +use Illuminate\Database\Eloquent\Model; |
|
9 | +use Spatie\EventProjector\EventSerializers\EventSerializer; |
|
10 | +use Spatie\EventProjector\Exceptions\InvalidStoredEvent; |
|
10 | 11 | use Spatie\EventProjector\Facades\Projectionist; |
12 | +use Spatie\EventProjector\ShouldBeStored; |
|
11 | 13 | use Spatie\SchemalessAttributes\SchemalessAttributes; |
12 | -use Spatie\EventProjector\Exceptions\InvalidStoredEvent; |
|
13 | -use Spatie\EventProjector\EventSerializers\EventSerializer; |
|
14 | 14 | |
15 | 15 | class StoredEvent extends Model |
16 | 16 | { |
@@ -3,13 +3,13 @@ |
||
3 | 3 | namespace Spatie\EventProjector\EventHandlers; |
4 | 4 | |
5 | 5 | use Exception; |
6 | +use Illuminate\Support\Collection; |
|
6 | 7 | use ReflectionClass; |
7 | 8 | use ReflectionMethod; |
8 | 9 | use ReflectionParameter; |
9 | -use Illuminate\Support\Collection; |
|
10 | -use Spatie\EventProjector\ShouldBeStored; |
|
11 | -use Spatie\EventProjector\Models\StoredEvent; |
|
12 | 10 | use Spatie\EventProjector\Exceptions\InvalidEventHandler; |
11 | +use Spatie\EventProjector\Models\StoredEvent; |
|
12 | +use Spatie\EventProjector\ShouldBeStored; |
|
13 | 13 | |
14 | 14 | trait HandlesEvents |
15 | 15 | { |
@@ -31,6 +31,9 @@ |
||
31 | 31 | $this->storedEventModel::store($event); |
32 | 32 | } |
33 | 33 | |
34 | + /** |
|
35 | + * @param string $event |
|
36 | + */ |
|
34 | 37 | private function shouldBeStored($event): bool |
35 | 38 | { |
36 | 39 | if (! class_exists($event)) { |
@@ -3,10 +3,10 @@ |
||
3 | 3 | namespace Spatie\EventProjector\Console; |
4 | 4 | |
5 | 5 | use Illuminate\Console\Command; |
6 | -use Illuminate\Support\Collection; |
|
7 | 6 | use Illuminate\Filesystem\Filesystem; |
8 | -use Spatie\EventProjector\Projectionist; |
|
7 | +use Illuminate\Support\Collection; |
|
9 | 8 | use Spatie\EventProjector\EventHandlers\EventHandler; |
9 | +use Spatie\EventProjector\Projectionist; |
|
10 | 10 | |
11 | 11 | final class CacheEventHandlersCommand extends Command |
12 | 12 | { |
@@ -5,15 +5,15 @@ |
||
5 | 5 | use Exception; |
6 | 6 | use Illuminate\Support\Arr; |
7 | 7 | use Illuminate\Support\Collection; |
8 | -use Spatie\EventProjector\Models\StoredEvent; |
|
9 | -use Spatie\EventProjector\Projectors\Projector; |
|
10 | 8 | use Spatie\EventProjector\EventHandlers\EventHandler; |
9 | +use Spatie\EventProjector\EventHandlers\EventHandlerCollection; |
|
10 | +use Spatie\EventProjector\Events\EventHandlerFailedHandlingEvent; |
|
11 | 11 | use Spatie\EventProjector\Events\FinishedEventReplay; |
12 | 12 | use Spatie\EventProjector\Events\StartingEventReplay; |
13 | -use Spatie\EventProjector\Projectors\QueuedProjector; |
|
14 | 13 | use Spatie\EventProjector\Exceptions\InvalidEventHandler; |
15 | -use Spatie\EventProjector\EventHandlers\EventHandlerCollection; |
|
16 | -use Spatie\EventProjector\Events\EventHandlerFailedHandlingEvent; |
|
14 | +use Spatie\EventProjector\Models\StoredEvent; |
|
15 | +use Spatie\EventProjector\Projectors\Projector; |
|
16 | +use Spatie\EventProjector\Projectors\QueuedProjector; |
|
17 | 17 | |
18 | 18 | final class Projectionist |
19 | 19 | { |
@@ -3,11 +3,11 @@ |
||
3 | 3 | namespace Spatie\EventProjector\Console; |
4 | 4 | |
5 | 5 | use Exception; |
6 | -use InvalidArgumentException; |
|
7 | 6 | use Illuminate\Console\Command; |
8 | 7 | use Illuminate\Support\Collection; |
9 | -use Spatie\EventProjector\Projectionist; |
|
8 | +use InvalidArgumentException; |
|
10 | 9 | use Spatie\EventProjector\Models\StoredEvent; |
10 | +use Spatie\EventProjector\Projectionist; |
|
11 | 11 | |
12 | 12 | class ReplayCommand extends Command |
13 | 13 | { |