@@ -6,7 +6,6 @@ |
||
| 6 | 6 | use Illuminate\Database\QueryException; |
| 7 | 7 | use SmoothPhp\Contracts\Domain\DomainEventStream; |
| 8 | 8 | use SmoothPhp\Contracts\Domain\DomainMessage; |
| 9 | -use SmoothPhp\Contracts\EventStore\DomainEventStreamInterface; |
|
| 10 | 9 | use SmoothPhp\Contracts\EventStore\EventStore; |
| 11 | 10 | use SmoothPhp\Contracts\Serialization\Serializer; |
| 12 | 11 | use SmoothPhp\Domain\DateTime; |
@@ -54,10 +54,10 @@ discard block |
||
| 54 | 54 | public function load($id) |
| 55 | 55 | { |
| 56 | 56 | $rows = $this->db->table($this->eventStoreTableName) |
| 57 | - ->select(['uuid', 'playhead', 'metadata', 'payload', 'recorded_on']) |
|
| 58 | - ->where('uuid', $id) |
|
| 59 | - ->orderBy('playhead', 'asc') |
|
| 60 | - ->get(); |
|
| 57 | + ->select(['uuid', 'playhead', 'metadata', 'payload', 'recorded_on']) |
|
| 58 | + ->where('uuid', $id) |
|
| 59 | + ->orderBy('playhead', 'asc') |
|
| 60 | + ->get(); |
|
| 61 | 61 | $events = []; |
| 62 | 62 | |
| 63 | 63 | foreach ($rows as $row) { |
@@ -154,13 +154,13 @@ discard block |
||
| 154 | 154 | public function getEventsByType($eventTypes, $skip, $take) |
| 155 | 155 | { |
| 156 | 156 | $rows = $this->db->table($this->eventStoreTableName) |
| 157 | - ->select(['uuid', 'playhead', 'metadata', 'payload', 'recorded_on']) |
|
| 158 | - ->whereIn('type', $eventTypes) |
|
| 159 | - ->skip($skip) |
|
| 160 | - ->take($take) |
|
| 161 | - ->orderBy('recorded_on', 'asc') |
|
| 162 | - ->orderBy('playhead', 'asc') |
|
| 163 | - ->get(); |
|
| 157 | + ->select(['uuid', 'playhead', 'metadata', 'payload', 'recorded_on']) |
|
| 158 | + ->whereIn('type', $eventTypes) |
|
| 159 | + ->skip($skip) |
|
| 160 | + ->take($take) |
|
| 161 | + ->orderBy('recorded_on', 'asc') |
|
| 162 | + ->orderBy('playhead', 'asc') |
|
| 163 | + ->get(); |
|
| 164 | 164 | $events = []; |
| 165 | 165 | |
| 166 | 166 | foreach ($rows as $row) { |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare (strict_types=1); |
|
| 1 | +<?php declare (strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace SmoothPhp\LaravelAdapter\Console; |
| 4 | 4 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $projectionRequest = collect(explode(',', $this->argument('projections'))); |
| 69 | 69 | |
| 70 | 70 | $projectionsServiceProviders = $projectionRequest->each( |
| 71 | - function ($projectionName) { |
|
| 71 | + function($projectionName) { |
|
| 72 | 72 | if (!isset($this->config->get('cqrses.projections_service_providers')[$projectionName])) { |
| 73 | 73 | $this->error("{$projectionName} Does not exist, check cqrses config"); |
| 74 | 74 | |
@@ -76,26 +76,26 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | )->map( |
| 79 | - function ($projectionName) { |
|
| 79 | + function($projectionName) { |
|
| 80 | 80 | return $this->application->make( |
| 81 | 81 | $this->config->get('cqrses.projections_service_providers')[$projectionName] |
| 82 | 82 | ); |
| 83 | 83 | } |
| 84 | 84 | )->each( |
| 85 | - function (ProjectionServiceProvider $projectionClass) { |
|
| 85 | + function(ProjectionServiceProvider $projectionClass) { |
|
| 86 | 86 | $this->downMigration($projectionClass); |
| 87 | 87 | } |
| 88 | 88 | )->each( |
| 89 | - function (ProjectionServiceProvider $projectionClass) { |
|
| 89 | + function(ProjectionServiceProvider $projectionClass) { |
|
| 90 | 90 | $this->upMigration($projectionClass); |
| 91 | 91 | } |
| 92 | 92 | ); |
| 93 | 93 | |
| 94 | 94 | /** @var Collection|Subscriber[] $projections */ |
| 95 | 95 | $projections = $projectionsServiceProviders->map( |
| 96 | - function (ProjectionServiceProvider $projectServiceProvider) { |
|
| 96 | + function(ProjectionServiceProvider $projectServiceProvider) { |
|
| 97 | 97 | return collect($projectServiceProvider->getProjections())->map( |
| 98 | - function ($projection) { |
|
| 98 | + function($projection) { |
|
| 99 | 99 | return $this->application->make($projection); |
| 100 | 100 | } |
| 101 | 101 | ); |
@@ -103,11 +103,11 @@ discard block |
||
| 103 | 103 | )->collapse(); |
| 104 | 104 | |
| 105 | 105 | $events = $projections->map( |
| 106 | - function (Subscriber $subscriber) { |
|
| 106 | + function(Subscriber $subscriber) { |
|
| 107 | 107 | return array_keys($subscriber->getSubscribedEvents()); |
| 108 | 108 | } |
| 109 | 109 | )->collapse()->map( |
| 110 | - function ($eventClassName) { |
|
| 110 | + function($eventClassName) { |
|
| 111 | 111 | return str_replace('\\', '.', $eventClassName); |
| 112 | 112 | } |
| 113 | 113 | ); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $this->output->progressAdvance($take > $eventCount ? $eventCount : $take); |
| 155 | 155 | } |
| 156 | 156 | $this->output->progressFinish(); |
| 157 | - $this->line((memory_get_peak_usage(true) / 1024 / 1024) . "mb Peak Usage", false); |
|
| 157 | + $this->line((memory_get_peak_usage(true) / 1024 / 1024)."mb Peak Usage", false); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | /** |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | ); |
| 188 | 188 | |
| 189 | 189 | $projections->each( |
| 190 | - function ($projection) use ($dispatcher) { |
|
| 190 | + function($projection) use ($dispatcher) { |
|
| 191 | 191 | $dispatcher->addSubscriber($projection); |
| 192 | 192 | } |
| 193 | 193 | ); |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types=1); |
|
| 1 | +<?php declare (strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace SmoothPhp\LaravelAdapter\QueuedEventDispatcher; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types=1); |
|
| 1 | +<?php declare (strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace SmoothPhp\LaravelAdapter\QueuedEventDispatcher; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare (strict_types=1); |
|
| 1 | +<?php declare (strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Tests\EventDispatcher\Helpers; |
| 4 | 4 | |
@@ -28,6 +28,6 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function getSubscribedEvents() |
| 30 | 30 | { |
| 31 | - return [TestEvent::class => ['whenTestEvent'],]; |
|
| 31 | + return [TestEvent::class => ['whenTestEvent'], ]; |
|
| 32 | 32 | } |
| 33 | 33 | } |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types=1); |
|
| 1 | +<?php declare (strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Tests\EventDispatcher\Helpers; |
| 4 | 4 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | public function test_pushing_event_to_queue() |
| 26 | 26 | { |
| 27 | 27 | $container = new Container(); |
| 28 | - // $container->bind(\Illuminate\Contracts\Container\Container::class, $container); |
|
| 28 | + // $container->bind(\Illuminate\Contracts\Container\Container::class, $container); |
|
| 29 | 29 | $queue = new Queue($container); |
| 30 | 30 | |
| 31 | 31 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types=1); |
|
| 1 | +<?php declare (strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Tests\EventDispatcher; |
| 4 | 4 | |