Skip to content

Commit

Permalink
Address feedback from GH review
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdude committed Jan 3, 2024
1 parent 84a76a9 commit 7cf8311
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 5 additions & 1 deletion lib/Doctrine/ORM/Internal/StronglyConnectedComponents.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ final class StronglyConnectedComponents
*/
private $representingNodes = [];

/** @var array<int> */
/**
* Stack with OIDs of nodes visited in the current state of the DFS
*
* @var list<int>
*/
private $stack = [];

/** @param object $node */
Expand Down
5 changes: 2 additions & 3 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/GH10912Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,14 @@ public function testIssue(): void

$this->_em->flush();

$queries = array_values(array_filter($queryLog->queries, static function ($entry) {
$queries = array_values(array_filter($queryLog->queries, static function (array $entry): bool {
return strpos($entry['sql'], 'DELETE') === 0;
}));

self::assertCount(3, $queries);

// $room deletion is the first query
// we do not care about the order of $user vs. $profile, so do not check them.
self::assertSame('DELETE FROM GH10912Room WHERE id = ?', $queries[0]['sql']);
self::assertSame('DELETE FROM GH10912Room WHERE id = ?', $queries[0]['sql'], '$room deletion is the first query');

// The EntityManager is aware that all three entities have been deleted (sanity check)
$im = $this->_em->getUnitOfWork()->getIdentityMap();
Expand Down
2 changes: 1 addition & 1 deletion tests/Doctrine/Tests/ORM/Functional/Ticket/GH10913Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private function flushAndAssertNumberOfDeleteQueries(int $expectedCount): void

$this->_em->flush();

$queries = array_values(array_filter($queryLog->queries, static function ($entry) {
$queries = array_values(array_filter($queryLog->queries, static function (array $entry): bool {
return strpos($entry['sql'], 'DELETE') === 0;
}));

Expand Down

0 comments on commit 7cf8311

Please sign in to comment.