@@ -100,7 +100,7 @@ public function testHasNothingToMapTo()
100100 {
101101 $ this ->expectException (MappingException::class);
102102 $ this ->expectExceptionMessage ('Mapping target not found for source "class@anonymous". ' );
103- (new ObjectMapper ())->map (new class () {});
103+ (new ObjectMapper ())->map (new class {});
104104 }
105105
106106 public function testHasNothingToMapToWithNamedClass ()
@@ -211,7 +211,7 @@ public function get(string $id): mixed
211211 };
212212 }
213213
214- public function testSourceOnly (): void
214+ public function testSourceOnly ()
215215 {
216216 $ a = new \stdClass ();
217217 $ a ->name = 'test ' ;
@@ -220,7 +220,7 @@ public function testSourceOnly(): void
220220 $ this ->assertInstanceOf (SourceOnly::class, $ mapped );
221221 $ this ->assertSame ('test ' , $ mapped ->mappedName );
222222
223- $ a = new class () {
223+ $ a = new class {
224224 public function __get (string $ key ): string
225225 {
226226 return match ($ key ) {
@@ -235,13 +235,12 @@ public function __get(string $key): string
235235 $ this ->assertSame ('test ' , $ mapped ->mappedName );
236236 }
237237
238-
239- public function testTransformToWrongValueType (): void
238+ public function testTransformToWrongValueType ()
240239 {
241240 $ this ->expectException (MappingTransformException::class);
242241 $ this ->expectExceptionMessage ('Cannot map "stdClass" to a non-object target of type "string". ' );
243242
244- $ u = new \stdClass ;
243+ $ u = new \stdClass () ;
245244 $ u ->foo = 'bar ' ;
246245
247246 $ metadata = $ this ->createStub (ObjectMapperMetadataFactoryInterface::class);
@@ -250,16 +249,16 @@ public function testTransformToWrongValueType(): void
250249 $ mapper ->map ($ u );
251250 }
252251
253- public function testTransformToWrongObject (): void
252+ public function testTransformToWrongObject ()
254253 {
255254 $ this ->expectException (MappingException::class);
256- $ this ->expectExceptionMessage (sprintf ('Expected the mapped object to be an instance of "%s" but got "stdClass". ' , ClassWithoutTarget::class));
255+ $ this ->expectExceptionMessage (\ sprintf ('Expected the mapped object to be an instance of "%s" but got "stdClass". ' , ClassWithoutTarget::class));
257256
258- $ u = new \stdClass ;
257+ $ u = new \stdClass () ;
259258 $ u ->foo = 'bar ' ;
260259
261260 $ metadata = $ this ->createStub (ObjectMapperMetadataFactoryInterface::class);
262- $ metadata ->method ('create ' )->with ($ u )->willReturn ([new Mapping (target: ClassWithoutTarget::class, transform: fn () => new \stdClass )]);
261+ $ metadata ->method ('create ' )->with ($ u )->willReturn ([new Mapping (target: ClassWithoutTarget::class, transform: fn () => new \stdClass () )]);
263262 $ mapper = new ObjectMapper ($ metadata );
264263 $ mapper ->map ($ u );
265264 }
0 commit comments