Skip to content

Commit d149d12

Browse files
authored
Merge pull request #18 from svycka/fix-deprecated-flush
fixed: Calling Doctrine\ORM\EntityManager::flush() with any arguments…
2 parents cee0374 + 4fc7f00 commit d149d12

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ All Notable changes to `svycka/sv-settings` will be documented in this file
1111
- Nothing
1212

1313
### Fixed
14-
- Nothing
14+
- [BC Break] Will call flush() on Doctrine entityManager without specific entity because it is deprecated
1515

1616
### Removed
1717
- Nothing

src/Storage/DoctrineStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function set(CollectionInterface $collection, $identifier, $name, $value)
6464
$setting->setValue($value);
6565

6666
$this->entityManager->persist($setting);
67-
$this->entityManager->flush($setting);
67+
$this->entityManager->flush();
6868
}
6969

7070
/**

tests/Settings/Storage/DoctrineStorageTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function (SettingInterface $value) {
5555
);
5656
$entityManager = $this->prophesize(EntityManagerInterface::class);
5757
$entityManager->persist($entity)->shouldBeCalled();
58-
$entityManager->flush($entity)->shouldBeCalled();
58+
$entityManager->flush()->shouldBeCalled();
5959
$repository = $this->prophesize(ObjectRepository::class);
6060
$repository->findOneBy([
6161
'collection' => $this->collection->getOptions()->getName(),
@@ -74,7 +74,7 @@ public function testCanUpdate()
7474
$setting->setValue($value = 'F')->shouldBeCalled();
7575
$entityManager = $this->prophesize(EntityManagerInterface::class);
7676
$entityManager->persist($setting->reveal())->shouldBeCalled();
77-
$entityManager->flush($setting->reveal())->shouldBeCalled();
77+
$entityManager->flush()->shouldBeCalled();
7878

7979
$repository = $this->prophesize(ObjectRepository::class);
8080
$repository->findOneBy([

0 commit comments

Comments
 (0)