diff --git a/CHANGELOG.md b/CHANGELOG.md index 786d524..151fe41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - New #97: Add HTTP cookie authentication method (@IbragimovDiyorbek) - Chg #95, #99: Change PHP constraint in `composer.json` to `8.0 - 8.4` (@vjik) - Bug #99: Explicitly mark nullable parameters (@vjik) +- Eng #100: Adapt summary data in debug collector (@rustamwin) ## 3.1.1 May 06, 2024 diff --git a/src/Debug/IdentityCollector.php b/src/Debug/IdentityCollector.php index 5b48537..0e65133 100644 --- a/src/Debug/IdentityCollector.php +++ b/src/Debug/IdentityCollector.php @@ -50,10 +50,8 @@ public function getSummary(): array } $lastIdentity = end($this->identities); return [ - 'identity' => [ - 'lastId' => is_array($lastIdentity) ? $lastIdentity['id'] : null, - 'total' => count($this->identities), - ], + 'lastId' => is_array($lastIdentity) ? $lastIdentity['id'] : null, + 'total' => count($this->identities), ]; } } diff --git a/tests/Debug/UserCollectorTest.php b/tests/Debug/UserCollectorTest.php index 5929b76..e99e8c6 100644 --- a/tests/Debug/UserCollectorTest.php +++ b/tests/Debug/UserCollectorTest.php @@ -44,9 +44,8 @@ protected function checkSummaryData(array $data): void { parent::checkSummaryData($data); - $this->assertArrayHasKey('identity', $data); - $this->assertArrayHasKey('lastId', $data['identity']); - $this->assertEquals('stub2', $data['identity']['lastId']); - $this->assertEquals(2, $data['identity']['total']); + $this->assertArrayHasKey('lastId', $data); + $this->assertEquals('stub2', $data['lastId']); + $this->assertEquals(2, $data['total']); } }