Skip to content

Commit

Permalink
Revert "fix skipped data persisters on persist"
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas authored Aug 22, 2018
1 parent 955b60f commit c211816
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
4 changes: 1 addition & 3 deletions src/DataPersister/ChainDataPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ public function persist($data)
{
foreach ($this->persisters as $persister) {
if ($persister->supports($data)) {
$data = $persister->persist($data) ?? $data;
return $persister->persist($data) ?? $data;
}
}

return $data;
}

/**
Expand Down
10 changes: 1 addition & 9 deletions tests/DataPersister/ChainDataPersisterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,7 @@ public function testPersist()
$barPersisterProphecy->supports($dummy)->willReturn(true)->shouldBeCalled();
$barPersisterProphecy->persist($dummy)->shouldBeCalled();

$bazPersisterProphecy = $this->prophesize(DataPersisterInterface::class);
$bazPersisterProphecy->supports($dummy)->willReturn(true)->shouldBeCalled();
$bazPersisterProphecy->persist($dummy)->shouldBeCalled();

(new ChainDataPersister([
$fooPersisterProphecy->reveal(),
$barPersisterProphecy->reveal(),
$bazPersisterProphecy->reveal(),
]))->persist($dummy);
(new ChainDataPersister([$fooPersisterProphecy->reveal(), $barPersisterProphecy->reveal()]))->persist($dummy);
}

public function testRemove()
Expand Down

0 comments on commit c211816

Please sign in to comment.