@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | ->boolean(file_exists($this->getMigratorFileName(\BlogEventSourced::class, $version))) |
62 | 62 | ->isTrue() |
63 | 63 | ->and() |
64 | - ->exception(function () use ($migrator, $version) { |
|
64 | + ->exception(function() use ($migrator, $version) { |
|
65 | 65 | $migrator->generate($version); |
66 | 66 | })->isInstanceOf(\RuntimeException::class) |
67 | 67 | ; |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | ->boolean($result) |
217 | 217 | ->isTrue() |
218 | 218 | ->and() |
219 | - ->exception(function () use ($migrator) { |
|
219 | + ->exception(function() use ($migrator) { |
|
220 | 220 | // because the V1_0_0\BlogEventSourcedMigration class return an invalid stream |
221 | 221 | $migrator->migrate(); |
222 | 222 | })->isInstanceOf(\RuntimeException::class) |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $this |
74 | 74 | ->given($postId = PostId::fromNative(md5(rand()))) |
75 | 75 | ->then() |
76 | - ->exception(function () use ($postId) { |
|
76 | + ->exception(function() use ($postId) { |
|
77 | 77 | new EventStream('posts', $postId, ['bar']); |
78 | 78 | })->isInstanceOf(\InvalidArgumentException::class) |
79 | 79 | ; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $this |
82 | 82 | ->given($postId = PostId::fromNative(md5(rand()))) |
83 | 83 | ->then() |
84 | - ->exception(function () use ($postId) { |
|
84 | + ->exception(function() use ($postId) { |
|
85 | 85 | new EventStream( |
86 | 86 | 'posts', |
87 | 87 | $postId, |
@@ -92,19 +92,19 @@ discard block |
||
92 | 92 | ->and($applicationVersion = new Version()) |
93 | 93 | ->when($store->persist($eventStream, $aggregateVersion, $applicationVersion)) |
94 | 94 | ->then() |
95 | - ->exception(function () use ($store, $postId, $aggregateVersion, $applicationVersion) { |
|
95 | + ->exception(function() use ($store, $postId, $aggregateVersion, $applicationVersion) { |
|
96 | 96 | $store->load('blogs', $postId, $aggregateVersion, $applicationVersion); |
97 | 97 | })->isInstanceOf(\RuntimeException::class) |
98 | - ->exception(function () use ($store, $postId, $applicationVersion) { |
|
98 | + ->exception(function() use ($store, $postId, $applicationVersion) { |
|
99 | 99 | $store->load('posts', $postId, new Version(0, 10, 456), $applicationVersion); |
100 | 100 | })->isInstanceOf(\RuntimeException::class) |
101 | - ->exception(function () use ($store, $aggregateVersion, $applicationVersion) { |
|
101 | + ->exception(function() use ($store, $aggregateVersion, $applicationVersion) { |
|
102 | 102 | $store->load('posts', PostId::fromNative(md5(rand())), $aggregateVersion, $applicationVersion); |
103 | 103 | })->isInstanceOf(\RuntimeException::class) |
104 | 104 | ->and() |
105 | 105 | ->when($applicationVersion = Version::fromString('2.1.0')) |
106 | 106 | ->then() |
107 | - ->exception(function () use ($store, $postId, $aggregateVersion, $applicationVersion) { |
|
107 | + ->exception(function() use ($store, $postId, $aggregateVersion, $applicationVersion) { |
|
108 | 108 | $store->load('posts', $postId, $aggregateVersion, $applicationVersion); |
109 | 109 | })->isInstanceOf(\RuntimeException::class) |
110 | 110 | ; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | ->and($aggregateVersion = new Version()) |
122 | 122 | ->and($applicationVersion = new Version()) |
123 | 123 | ->then() |
124 | - ->exception(function () use ($store, $postId, $aggregateVersion, $applicationVersion) { |
|
124 | + ->exception(function() use ($store, $postId, $aggregateVersion, $applicationVersion) { |
|
125 | 125 | $store->remove('posts', $postId, $aggregateVersion, $applicationVersion); |
126 | 126 | })->isInstanceOf(\RuntimeException::class) |
127 | 127 | ; |
@@ -135,13 +135,13 @@ discard block |
||
135 | 135 | ->when($store->persist($eventStream, $aggregateVersion, $applicationVersion)) |
136 | 136 | ->and($store->remove('posts', $postId, $aggregateVersion, $applicationVersion)) |
137 | 137 | ->then() |
138 | - ->exception(function () use ($store, $postId, $aggregateVersion, $applicationVersion) { |
|
138 | + ->exception(function() use ($store, $postId, $aggregateVersion, $applicationVersion) { |
|
139 | 139 | $store->load('posts', $postId, $aggregateVersion, $applicationVersion); |
140 | 140 | })->isInstanceOf(\RuntimeException::class) |
141 | - ->exception(function () use ($store, $postId, $aggregateVersion, $applicationVersion) { |
|
141 | + ->exception(function() use ($store, $postId, $aggregateVersion, $applicationVersion) { |
|
142 | 142 | $store->remove('blogs', $postId, $aggregateVersion, $applicationVersion); |
143 | 143 | })->isInstanceOf(\RuntimeException::class) |
144 | - ->exception(function () use ($store, $postId, $applicationVersion) { |
|
144 | + ->exception(function() use ($store, $postId, $applicationVersion) { |
|
145 | 145 | $store->remove('posts', $postId, new Version(0, 10, 456), $applicationVersion); |
146 | 146 | })->isInstanceOf(\RuntimeException::class) |
147 | 147 | ; |
@@ -163,10 +163,10 @@ discard block |
||
163 | 163 | ->when($store->persist($eventStream, $aggregateVersion, $applicationVersion)) |
164 | 164 | ->and($store->persist($eventStream1, $aggregateVersion, $applicationVersion)) |
165 | 165 | ->then() |
166 | - ->exception(function () use ($store, $aggregateVersion, $applicationVersion) { |
|
166 | + ->exception(function() use ($store, $aggregateVersion, $applicationVersion) { |
|
167 | 167 | $store->loadAll('blogs', $aggregateVersion, $applicationVersion); |
168 | 168 | })->isInstanceOf(\RuntimeException::class) |
169 | - ->exception(function () use ($store, $applicationVersion) { |
|
169 | + ->exception(function() use ($store, $applicationVersion) { |
|
170 | 170 | $store->loadAll('posts', new Version(0, 10, 456), $applicationVersion); |
171 | 171 | })->isInstanceOf(\RuntimeException::class) |
172 | 172 | ->array($store->loadAll('posts', $aggregateVersion, $applicationVersion)) |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | ->and() |
175 | 175 | ->when($applicationVersion = Version::fromString('2.1.0')) |
176 | 176 | ->then() |
177 | - ->exception(function () use ($store, $aggregateVersion, $applicationVersion) { |
|
177 | + ->exception(function() use ($store, $aggregateVersion, $applicationVersion) { |
|
178 | 178 | $store->loadAll('posts', $aggregateVersion, $applicationVersion); |
179 | 179 | })->isInstanceOf(\RuntimeException::class) |
180 | 180 | ; |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | ->and($aggregateVersion = new Version()) |
192 | 192 | ->and($applicationVersion = new Version()) |
193 | 193 | ->then() |
194 | - ->exception(function () use ($store, $aggregateVersion, $applicationVersion) { |
|
194 | + ->exception(function() use ($store, $aggregateVersion, $applicationVersion) { |
|
195 | 195 | $store->removeAll('posts', $aggregateVersion, $applicationVersion); |
196 | 196 | })->isInstanceOf(\RuntimeException::class) |
197 | 197 | ; |
@@ -212,14 +212,14 @@ discard block |
||
212 | 212 | ->and() |
213 | 213 | ->when($store->removeAll('posts', $aggregateVersion, $applicationVersion)) |
214 | 214 | ->then() |
215 | - ->exception(function () use ($store, $aggregateVersion, $applicationVersion) { |
|
215 | + ->exception(function() use ($store, $aggregateVersion, $applicationVersion) { |
|
216 | 216 | // because there is no stream entry in the current application store |
217 | 217 | $store->loadAll('posts', $aggregateVersion, $applicationVersion); |
218 | 218 | })->isInstanceOf(\RuntimeException::class) |
219 | 219 | ->and() |
220 | 220 | ->when($applicationVersion = Version::fromString('2.1.0')) |
221 | 221 | ->then() |
222 | - ->exception(function () use ($store, $aggregateVersion, $applicationVersion) { |
|
222 | + ->exception(function() use ($store, $aggregateVersion, $applicationVersion) { |
|
223 | 223 | // because there is application entry in the store |
224 | 224 | $store->removeAll('posts', $aggregateVersion, $applicationVersion); |
225 | 225 | })->isInstanceOf(\RuntimeException::class) |
@@ -64,7 +64,7 @@ |
||
64 | 64 | ; |
65 | 65 | |
66 | 66 | $this |
67 | - ->exception(function () { |
|
67 | + ->exception(function() { |
|
68 | 68 | new CompositeSnapshottingPolicy( |
69 | 69 | [new AllwaysSnapshottingPolicy(), 'foo'] |
70 | 70 | ); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | ->and($post->clearEvents()) |
69 | 69 | ->when($repository->persist($post)) |
70 | 70 | ->then() |
71 | - ->exception(function () use ($repository, $post) { |
|
71 | + ->exception(function() use ($repository, $post) { |
|
72 | 72 | $repository->get($post->id()); |
73 | 73 | }) |
74 | 74 | ->isInstanceOf(\RuntimeException::class) |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | ) |
85 | 85 | ) |
86 | 86 | ->then() |
87 | - ->exception(function () use ($repository, $post) { |
|
87 | + ->exception(function() use ($repository, $post) { |
|
88 | 88 | $repository->persist($post); |
89 | 89 | }) |
90 | 90 | ->isInstanceOf(\InvalidArgumentException::class) |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | ->and() |
163 | 163 | ->when($repository->remove($post)) |
164 | 164 | ->then() |
165 | - ->exception(function () use ($repository, $post) { |
|
165 | + ->exception(function() use ($repository, $post) { |
|
166 | 166 | $repository->get($post->id()); |
167 | 167 | })->isInstanceOf(\RuntimeException::class) |
168 | 168 | ; |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | ) |
178 | 178 | ) |
179 | 179 | ->then() |
180 | - ->exception(function () use ($repository, $post) { |
|
180 | + ->exception(function() use ($repository, $post) { |
|
181 | 181 | $repository->remove($post); |
182 | 182 | }) |
183 | 183 | ->isInstanceOf(\InvalidArgumentException::class) |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | ) |
58 | 58 | ) |
59 | 59 | ->then() |
60 | - ->exception(function () use ($post) { |
|
60 | + ->exception(function() use ($post) { |
|
61 | 61 | $post->remove(); |
62 | 62 | })->isInstanceOf(\BadMethodCallException::class) |
63 | 63 | ; |
@@ -175,16 +175,16 @@ discard block |
||
175 | 175 | ->array($post->recordedEvents()) |
176 | 176 | ->hasSize(2) |
177 | 177 | ->and() |
178 | - ->exception(function () use ($post) { |
|
178 | + ->exception(function() use ($post) { |
|
179 | 179 | $post->changeTitle(''); |
180 | 180 | })->isInstanceOf(ValidationException::class) |
181 | - ->exception(function () use ($post) { |
|
181 | + ->exception(function() use ($post) { |
|
182 | 182 | $post->changeTitle(10); |
183 | 183 | })->isInstanceOf(ValidationException::class) |
184 | 184 | ; |
185 | 185 | |
186 | 186 | $this |
187 | - ->exception(function () { |
|
187 | + ->exception(function() { |
|
188 | 188 | PostEventSourcedFactory::create('', $this->faker->paragraph); |
189 | 189 | })->isInstanceOf(ValidationException::class) |
190 | 190 | ; |
@@ -107,14 +107,14 @@ |
||
107 | 107 | ->isEqualTo($eventId) |
108 | 108 | ->string['eventType'] |
109 | 109 | ->isEqualTo(PostWasCreated::class) |
110 | - ->child['metadata'](function ($metadata) use ($postId) { |
|
110 | + ->child['metadata'](function($metadata) use ($postId) { |
|
111 | 111 | $metadata |
112 | 112 | ->hasKey('occurredOn') |
113 | 113 | ->object['aggregateId'] |
114 | 114 | ->isEqualTo($postId) |
115 | 115 | ; |
116 | 116 | }) |
117 | - ->child['payload'](function ($payload) use ($title, $content) { |
|
117 | + ->child['payload'](function($payload) use ($title, $content) { |
|
118 | 118 | $payload |
119 | 119 | ->isEqualTo(array( |
120 | 120 | 'title' => $title, |