From 82bc9c9647d05d345fb1d966d215caa3969a2ea4 Mon Sep 17 00:00:00 2001 From: JoaoFerrazfs Date: Tue, 1 Oct 2024 14:19:48 -0300 Subject: [PATCH] refactor: changed annotations --- src/Cursor/Cursor.php | 16 +--------------- src/Cursor/EmbeddedCursor.php | 2 -- src/Cursor/SchemaCacheableCursor.php | 4 ---- src/Cursor/SchemaCursor.php | 6 +----- src/Cursor/SchemaEmbeddedCursor.php | 2 +- 5 files changed, 3 insertions(+), 27 deletions(-) diff --git a/src/Cursor/Cursor.php b/src/Cursor/Cursor.php index 46b79434..3738b1fe 100644 --- a/src/Cursor/Cursor.php +++ b/src/Cursor/Cursor.php @@ -23,13 +23,11 @@ class Cursor implements CursorInterface { /** * The MongoDB cursor used to interact with db. - * */ protected ?Iterator $cursor = null; /** * Iterator position (to be used with foreach). - * */ protected int $position = 0; @@ -49,8 +47,6 @@ public function __construct( * Limits the number of results returned. * * @param int $amount the number of results to return - * - * @return static */ public function limit(int $amount): static { @@ -65,8 +61,6 @@ public function limit(int $amount): static * @param array $fields An array of fields by which to sort. * Each element in the array has as key the field name, * and as value either 1 for ascending sort, or -1 for descending sort. - * - * @return static */ public function sort(array $fields): static { @@ -79,8 +73,6 @@ public function sort(array $fields): static * Skips a number of results. * * @param int $amount the number of results to skip - * - * @return static */ public function skip(int $amount): static { @@ -110,8 +102,6 @@ public function disableTimeout(bool $flag = true): static * @param int $mode preference mode that the Cursor will use * * @see ReadPreference::class To get a glance of the constants available - * - * @return $this */ public function setReadPreference(int $mode): static { @@ -121,9 +111,7 @@ public function setReadPreference(int $mode): static } /** - * Counts the number of results for this cursor. - * - * @return int the number of documents returned by this cursor's query + * Counts the number of documents returned by this cursor's query. */ public function count(): int { @@ -255,8 +243,6 @@ public function __serialize(): array /** * Unserializes this object. Re-creating the database connection. - * - * @param array $serialized serialized cursor */ public function __unserialize(array $attributes): void { diff --git a/src/Cursor/EmbeddedCursor.php b/src/Cursor/EmbeddedCursor.php index 29eb6716..07dde56c 100644 --- a/src/Cursor/EmbeddedCursor.php +++ b/src/Cursor/EmbeddedCursor.php @@ -45,8 +45,6 @@ public function limit(int $amount): static * @param array $fields An array of fields by which to sort. * Each element in the array has as key the field name, * and as value either 1 for ascending sort, or -1 for descending sort. - * - * @return EmbeddedCursor returns this cursor */ public function sort(array $fields): static { diff --git a/src/Cursor/SchemaCacheableCursor.php b/src/Cursor/SchemaCacheableCursor.php index 7ee21c01..1d250618 100644 --- a/src/Cursor/SchemaCacheableCursor.php +++ b/src/Cursor/SchemaCacheableCursor.php @@ -32,14 +32,12 @@ class SchemaCacheableCursor extends SchemaCursor /** * Limit of the query. It is stored because when caching the documents * the DOCUMENT_LIMIT const will be used. - * */ protected int $originalLimit = 0; /** * Means that the CacheableCursor is wapping the original cursor and not * reading from Cache anymore. - * */ protected bool $ignoreCache = false; @@ -105,8 +103,6 @@ protected function getCursor(): Iterator /** * Generates an unique cache key for the cursor in it's current state. - * - * @return string cache key to identify the query of the current cursor */ protected function generateCacheKey(): string { diff --git a/src/Cursor/SchemaCursor.php b/src/Cursor/SchemaCursor.php index 8b654efa..4b89408c 100644 --- a/src/Cursor/SchemaCursor.php +++ b/src/Cursor/SchemaCursor.php @@ -10,9 +10,7 @@ use Mongolid\Connection\Connection; use Mongolid\Container\Container; use Mongolid\LegacyRecord; -use Traversable; use MongoDB\Collection; -use MongoDB\Driver\Cursor as DriverCursor; use MongoDB\Driver\Exception\LogicException; use Mongolid\DataMapper\EntityAssembler; use Mongolid\Schema\Schema; @@ -122,9 +120,7 @@ public function setReadPreference(int $mode): static } /** - * Counts the number of results for this cursor. - * - * @return int the number of documents returned by this cursor's query + * Counts the number of results documents returned by this cursor's query. */ public function count(): int { diff --git a/src/Cursor/SchemaEmbeddedCursor.php b/src/Cursor/SchemaEmbeddedCursor.php index 0aff3267..5a0f089b 100644 --- a/src/Cursor/SchemaEmbeddedCursor.php +++ b/src/Cursor/SchemaEmbeddedCursor.php @@ -92,7 +92,7 @@ public function skip(int $amount): static } /** - * Counts the number of results for this cursor. + * Counts the number of documents returned by this cursor's query. */ public function count(): int {