File tree Expand file tree Collapse file tree 2 files changed +2
-12
lines changed Expand file tree Collapse file tree 2 files changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -51,11 +51,9 @@ public function persist($data)
51
51
{
52
52
foreach ($ this ->persisters as $ persister ) {
53
53
if ($ persister ->supports ($ data )) {
54
- $ data = $ persister ->persist ($ data ) ?? $ data ;
54
+ return $ persister ->persist ($ data ) ?? $ data ;
55
55
}
56
56
}
57
-
58
- return $ data ;
59
57
}
60
58
61
59
/**
Original file line number Diff line number Diff line change @@ -60,15 +60,7 @@ public function testPersist()
60
60
$ barPersisterProphecy ->supports ($ dummy )->willReturn (true )->shouldBeCalled ();
61
61
$ barPersisterProphecy ->persist ($ dummy )->shouldBeCalled ();
62
62
63
- $ bazPersisterProphecy = $ this ->prophesize (DataPersisterInterface::class);
64
- $ bazPersisterProphecy ->supports ($ dummy )->willReturn (true )->shouldBeCalled ();
65
- $ bazPersisterProphecy ->persist ($ dummy )->shouldBeCalled ();
66
-
67
- (new ChainDataPersister ([
68
- $ fooPersisterProphecy ->reveal (),
69
- $ barPersisterProphecy ->reveal (),
70
- $ bazPersisterProphecy ->reveal (),
71
- ]))->persist ($ dummy );
63
+ (new ChainDataPersister ([$ fooPersisterProphecy ->reveal (), $ barPersisterProphecy ->reveal ()]))->persist ($ dummy );
72
64
}
73
65
74
66
public function testRemove ()
You can’t perform that action at this time.
0 commit comments