@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function fire($job, $data) |
| 37 | 37 | { |
| 38 | - $payload = (json_decode($data['payload'],true)); |
|
| 38 | + $payload = (json_decode($data['payload'], true)); |
|
| 39 | 39 | |
| 40 | 40 | $event = call_user_func([ |
| 41 | 41 | str_replace('.', '\\', $data['type']), |
@@ -38,11 +38,11 @@ |
||
| 38 | 38 | { |
| 39 | 39 | $this->queue->push(QueueToEventDispatcher::class, |
| 40 | 40 | [ |
| 41 | - 'uuid' => (string)$domainMessage->getId(), |
|
| 41 | + 'uuid' => (string) $domainMessage->getId(), |
|
| 42 | 42 | 'playhead' => $domainMessage->getPlayHead(), |
| 43 | 43 | 'metadata' => json_encode($this->serializer->serialize($domainMessage->getMetadata())), |
| 44 | 44 | 'payload' => json_encode($this->serializer->serialize($domainMessage->getPayload())), |
| 45 | - 'recorded_on' => (string)$domainMessage->getRecordedOn(), |
|
| 45 | + 'recorded_on' => (string) $domainMessage->getRecordedOn(), |
|
| 46 | 46 | 'type' => $domainMessage->getType(), |
| 47 | 47 | ]); |
| 48 | 48 | } |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | |
| 59 | 59 | Schema::connection($this->config->get('cqrses.eventstore_connection')) |
| 60 | 60 | ->create($this->config->get('cqrses.eventstore_table'), |
| 61 | - function (Blueprint $table) { |
|
| 61 | + function(Blueprint $table) { |
|
| 62 | 62 | $table->increments('id'); |
| 63 | 63 | $table->string('uuid', 56); |
| 64 | 64 | $table->integer('playhead')->unsigned(); |
@@ -80,13 +80,13 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function append($id, DomainEventStream $eventStream) |
| 82 | 82 | { |
| 83 | - $id = (string)$id; //Used to thrown errors if ID will not cast to string |
|
| 83 | + $id = (string) $id; //Used to thrown errors if ID will not cast to string |
|
| 84 | 84 | |
| 85 | 85 | $this->db->beginTransaction(); |
| 86 | 86 | |
| 87 | 87 | try { |
| 88 | 88 | foreach ($eventStream as $domainMessage) { |
| 89 | - $this->insertEvent( $domainMessage); |
|
| 89 | + $this->insertEvent($domainMessage); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | $this->db->commit(); |
@@ -105,11 +105,11 @@ discard block |
||
| 105 | 105 | $this->db->table($this->eventStoreTableName) |
| 106 | 106 | ->insert( |
| 107 | 107 | [ |
| 108 | - 'uuid' => (string)$domainMessage->getId(), |
|
| 108 | + 'uuid' => (string) $domainMessage->getId(), |
|
| 109 | 109 | 'playhead' => $domainMessage->getPlayHead(), |
| 110 | 110 | 'metadata' => json_encode($this->serializer->serialize($domainMessage->getMetadata())), |
| 111 | 111 | 'payload' => json_encode($this->serializer->serialize($domainMessage->getPayload())), |
| 112 | - 'recorded_on' => (string)$domainMessage->getRecordedOn(), |
|
| 112 | + 'recorded_on' => (string) $domainMessage->getRecordedOn(), |
|
| 113 | 113 | 'type' => $domainMessage->getType(), |
| 114 | 114 | ] |
| 115 | 115 | ); |
@@ -46,11 +46,11 @@ |
||
| 46 | 46 | $this->queue->push( |
| 47 | 47 | QueueToEventDispatcherWithCommandId::class, |
| 48 | 48 | [ |
| 49 | - 'uuid' => (string)$domainMessage->getId(), |
|
| 49 | + 'uuid' => (string) $domainMessage->getId(), |
|
| 50 | 50 | 'playhead' => $domainMessage->getPlayHead(), |
| 51 | 51 | 'metadata' => json_encode($this->serializer->serialize($domainMessage->getMetadata())), |
| 52 | 52 | 'payload' => json_encode($this->serializer->serialize($domainMessage->getPayload())), |
| 53 | - 'recorded_on' => (string)$domainMessage->getRecordedOn(), |
|
| 53 | + 'recorded_on' => (string) $domainMessage->getRecordedOn(), |
|
| 54 | 54 | 'type' => $domainMessage->getType(), |
| 55 | 55 | 'command_id' => $this->notificationsCommandBus->getLastCommandId(), |
| 56 | 56 | ] |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | foreach ($commands as $command) { |
| 19 | - while (!Cache::has((string)$command)) { |
|
| 19 | + while (!Cache::has((string) $command)) { |
|
| 20 | 20 | usleep(1000); |
| 21 | 21 | |
| 22 | 22 | if ($i > 8000) { |
@@ -33,6 +33,6 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | function uuid() |
| 35 | 35 | { |
| 36 | - return (string)\Ramsey\Uuid\Uuid::uuid4(); |
|
| 36 | + return (string) \Ramsey\Uuid\Uuid::uuid4(); |
|
| 37 | 37 | } |
| 38 | 38 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public function execute(Command $command) |
| 35 | 35 | { |
| 36 | - $this->lastCommandId = (string)$command; |
|
| 36 | + $this->lastCommandId = (string) $command; |
|
| 37 | 37 | $this->commandBus->execute($command); |
| 38 | 38 | } |
| 39 | 39 | |
@@ -29,9 +29,9 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | public function handle(DomainMessage $domainMessage) |
| 31 | 31 | { |
| 32 | - $name = explode('.',$domainMessage->getType()); |
|
| 32 | + $name = explode('.', $domainMessage->getType()); |
|
| 33 | 33 | |
| 34 | 34 | $name = preg_replace('/(?!^)[A-Z]{2,}(?=[A-Z][a-z])|[A-Z][a-z]/', ' $0', end($name)); |
| 35 | - $this->log->debug(trim(ucwords($name)) . " ({$domainMessage->getType()})"); |
|
| 35 | + $this->log->debug(trim(ucwords($name))." ({$domainMessage->getType()})"); |
|
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | \ No newline at end of file |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | public function register() |
| 41 | 41 | { |
| 42 | 42 | |
| 43 | - $configPath = __DIR__ . '/../config/cqrses.php'; |
|
| 43 | + $configPath = __DIR__.'/../config/cqrses.php'; |
|
| 44 | 44 | $this->mergeConfigFrom($configPath, 'cqrses'); |
| 45 | 45 | |
| 46 | 46 | $app = $this->app; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | public function boot() |
| 74 | 74 | { |
| 75 | - $configPath = __DIR__ . '/../config/cqrses.php'; |
|
| 75 | + $configPath = __DIR__.'/../config/cqrses.php'; |
|
| 76 | 76 | $this->publishes([$configPath => $this->getConfigPath()], 'config'); |
| 77 | 77 | |
| 78 | 78 | } |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | $this->app->singleton( |
| 120 | 120 | CommandBus::class, |
| 121 | - function () use ($middlewareChain) { |
|
| 121 | + function() use ($middlewareChain) { |
|
| 122 | 122 | return new \SmoothPhp\CommandBus\CommandBus($middlewareChain); |
| 123 | 123 | } |
| 124 | 124 | ); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | if ($app['config']->get('cqrses.laravel_eventstore_enabled')) { |
| 142 | 142 | $app->bind( |
| 143 | 143 | EventStore::class, |
| 144 | - function (Application $application) { |
|
| 144 | + function(Application $application) { |
|
| 145 | 145 | return new LaravelEventStore( |
| 146 | 146 | $application->make(DatabaseManager::class), |
| 147 | 147 | $application->make(Serializer::class), |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | { |
| 161 | 161 | $app->singleton( |
| 162 | 162 | EventBus::class, |
| 163 | - function (Application $application) { |
|
| 163 | + function(Application $application) { |
|
| 164 | 164 | $eventBus = $application->make($application['config']->get('cqrses.event_bus')); |
| 165 | 165 | |
| 166 | 166 | foreach ($application['config']->get('cqrses.event_bus_listeners') as $listener) { |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | { |
| 180 | 180 | $app->singleton( |
| 181 | 181 | EventDispatcher::class, |
| 182 | - function (Application $application) { |
|
| 182 | + function(Application $application) { |
|
| 183 | 183 | return $application->make($application['config']->get('cqrses.event_dispatcher')); |
| 184 | 184 | } |
| 185 | 185 | ); |