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)
5151 {
5252 foreach ($ this ->persisters as $ persister ) {
5353 if ($ persister ->supports ($ data )) {
54- $ data = $ persister ->persist ($ data ) ?? $ data ;
54+ return $ persister ->persist ($ data ) ?? $ data ;
5555 }
5656 }
57-
58- return $ data ;
5957 }
6058
6159 /**
Original file line number Diff line number Diff line change @@ -60,15 +60,7 @@ public function testPersist()
6060 $ barPersisterProphecy ->supports ($ dummy )->willReturn (true )->shouldBeCalled ();
6161 $ barPersisterProphecy ->persist ($ dummy )->shouldBeCalled ();
6262
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 );
7264 }
7365
7466 public function testRemove ()
You can’t perform that action at this time.
0 commit comments