Skip to content

Commit

Permalink
CSFIX
Browse files Browse the repository at this point in the history
  • Loading branch information
bigfoot90 committed Sep 14, 2021
1 parent 5f50737 commit 44536ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ class UnitOfWork implements PropertyChangedListener
*
* DDC-2332 / #3037
*
* @var array
* @psalm-var array<string, object>
*/
private $oidMap = array();
private $oidMap = [];

/**
* Initializes a new UnitOfWork instance, bound to the given EntityManager.
Expand Down
12 changes: 6 additions & 6 deletions tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Doctrine\Tests\OrmFunctionalTestCase;

use function count;
use function gc_collect_cycles;
use function get_class;

/**
Expand Down Expand Up @@ -271,15 +272,14 @@ public function testHashCollision(): void
$this->_em->flush();

$articles = [];
for ($i = 0; $i < 100; $i++) {
$article = new CmsArticle();
for ($i = 0; $i < 100; ++$i) {
$articles[$i] = $article = new CmsArticle();
$article->topic = 'Test';
$article->text = 'Test';
$article->setAuthor($this->_em->merge($user));
$this->_em->persist($article);
$this->_em->flush();
$this->_em->clear();
$articles [] = $article;
}

$user = $this->_em->merge($user);
Expand All @@ -293,14 +293,14 @@ public function testHashCollision(): void
gc_collect_cycles();
$keep = [];

for ($x = 0; $x < 1000; $x++) {
$keep[] = $article = new CmsArticle();
for ($x = 0; $x < 1000; ++$x) {
$keep[$x] = $article = new CmsArticle();
$article->topic = 'Test';
$article->text = 'Test';
$article->setAuthor($this->_em->merge($user));
$this->_em->persist($article);
$this->_em->flush();
$this->assertNotNull($article->id, 'Article wasn\'t persisted on iteration '.$x);
$this->assertNotNull($article->id, 'Article wasn\'t persisted on iteration ' . $x);
}
}
}

0 comments on commit 44536ff

Please sign in to comment.