From 3b1b0d743bb25f8ef01954d43308e02c4c6a6427 Mon Sep 17 00:00:00 2001 From: Jorge Lapa <2780099+heyjorgedev@users.noreply.github.com> Date: Thu, 20 Feb 2025 11:08:55 +0700 Subject: [PATCH] test: introduce rectorphp --- composer.json | 1 + rector.php | 17 +++++++++++++++++ tests/Dense/Operations/RangeVectorsTest.php | 10 +++++----- 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 rector.php diff --git a/composer.json b/composer.json index 1d23f46..18c4ab3 100644 --- a/composer.json +++ b/composer.json @@ -34,6 +34,7 @@ "nunomaduro/collision": "^8.5", "phpstan/phpstan": "^2.1", "phpunit/phpunit": "^11.5.6", + "rector/rector": "^2.0", "robiningelbrecht/phpunit-pretty-print": "^1.3", "spatie/ray": "^1.28", "symfony/http-client": "^7.2", diff --git a/rector.php b/rector.php new file mode 100644 index 0000000..81bd3cb --- /dev/null +++ b/rector.php @@ -0,0 +1,17 @@ +withPaths([ + __DIR__ . '/examples', + __DIR__ . '/src', + __DIR__ . '/tests', + ]) + // uncomment to reach your current PHP version + // ->withPhpSets() + ->withTypeCoverageLevel(0) + ->withDeadCodeLevel(0) + ->withCodeQualityLevel(0); diff --git a/tests/Dense/Operations/RangeVectorsTest.php b/tests/Dense/Operations/RangeVectorsTest.php index b51372e..d0998c4 100644 --- a/tests/Dense/Operations/RangeVectorsTest.php +++ b/tests/Dense/Operations/RangeVectorsTest.php @@ -39,7 +39,7 @@ public function test_can_range_vectors(): void $this->namespace->upsertMany($this->generateUpserts(100)); $this->waitForIndex($this->namespace); - $memory = $this->measureMemory(function () { + $memory = $this->measureMemory(function (): void { // Act $results = $this->namespace->range(new VectorRange(limit: 10)); @@ -57,7 +57,7 @@ public function test_can_range_vectors_with_next_helper(): void $this->namespace->upsertMany($this->generateUpserts(100)); $this->waitForIndex($this->namespace); - $memory = $this->measureMemory(function () { + $memory = $this->measureMemory(function (): void { // Act $results = $this->namespace->range(new VectorRange(limit: 10)); @@ -81,7 +81,7 @@ public function test_can_range_vectors_using_next_cursor(): void $this->namespace->upsertMany($this->generateUpserts(100)); $this->waitForIndex($this->namespace); - $memory = $this->measureMemory(function () { + $memory = $this->measureMemory(function (): void { // Act $results = $this->namespace->range(new VectorRange(limit: 10)); @@ -105,7 +105,7 @@ public function test_can_range_vectors_using_iterator(): void $this->namespace->upsertMany($this->generateUpserts(100)); $this->waitForIndex($this->namespace); - $memory = $this->measureMemory(function () { + $memory = $this->measureMemory(function (): void { // Arrange $count = 0; @@ -136,7 +136,7 @@ public function test_can_range_vectors_using_iterator_can_break_loop(): void $this->namespace->upsertMany($this->generateUpserts(100)); $this->waitForIndex($this->namespace); - $memory = $this->measureMemory(function () { + $memory = $this->measureMemory(function (): void { // Arrange $count = 0;