From 230dc9fa30a1aa6ca4e207e567a1b2500c528fb3 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Tue, 13 Feb 2024 10:06:41 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Transaction/TupleStorage.php | 2 ++ .../Driver/Common/Integration/Issue380/schema.php | 1 - tests/ORM/Unit/Transaction/TupleStorageTest.php | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Transaction/TupleStorage.php b/src/Transaction/TupleStorage.php index a51cea7e..f1ba1308 100644 --- a/src/Transaction/TupleStorage.php +++ b/src/Transaction/TupleStorage.php @@ -9,6 +9,7 @@ /** * @internal + * * @implements IteratorAggregate */ final class TupleStorage implements IteratorAggregate, Countable @@ -27,6 +28,7 @@ public function getIterator(): \Traversable // When the generator is destroyed, the reference to the iterator is removed from the collection. $cleaner = new class () { public array $iterators; + public function __destruct() { unset($this->iterators[\spl_object_id($this)]); diff --git a/tests/ORM/Functional/Driver/Common/Integration/Issue380/schema.php b/tests/ORM/Functional/Driver/Common/Integration/Issue380/schema.php index 3762a923..6cf8b102 100644 --- a/tests/ORM/Functional/Driver/Common/Integration/Issue380/schema.php +++ b/tests/ORM/Functional/Driver/Common/Integration/Issue380/schema.php @@ -170,5 +170,4 @@ ], Schema::SCHEMA => [], ], - ]; diff --git a/tests/ORM/Unit/Transaction/TupleStorageTest.php b/tests/ORM/Unit/Transaction/TupleStorageTest.php index 9954d624..9b5fa177 100644 --- a/tests/ORM/Unit/Transaction/TupleStorageTest.php +++ b/tests/ORM/Unit/Transaction/TupleStorageTest.php @@ -93,7 +93,7 @@ public function testAddItemsWhenIterating(): void } /** @see TupleStorage::$iterators */ - self::assertCount(0, (fn(): array => $this->iterators)->call($storage)); + self::assertCount(0, (fn (): array => $this->iterators)->call($storage)); $iterator = $storage->getIterator(); // Start generator @@ -101,12 +101,12 @@ public function testAddItemsWhenIterating(): void break; } /** @see TupleStorage::$iterators */ - self::assertCount(1, (fn(): array => $this->iterators)->call($storage)); + self::assertCount(1, (fn (): array => $this->iterators)->call($storage)); // Cleanup on iterator destruction unset($iterator); /** @see TupleStorage::$iterators */ - self::assertCount(0, (fn(): array => $this->iterators)->call($storage)); + self::assertCount(0, (fn (): array => $this->iterators)->call($storage)); // Cleanup on end of iteration $iterator = $storage->getIterator(); @@ -115,7 +115,7 @@ public function testAddItemsWhenIterating(): void // do nothing } /** @see TupleStorage::$iterators */ - self::assertCount(0, (fn(): array => $this->iterators)->call($storage)); + self::assertCount(0, (fn (): array => $this->iterators)->call($storage)); } public function testDetachWhenIterating(): void