1010use DirectoryTree \OpenSearchScoutDriver \Factories \DocumentFactoryInterface ;
1111use DirectoryTree \OpenSearchScoutDriver \Factories \ModelFactoryInterface ;
1212use DirectoryTree \OpenSearchScoutDriver \Factories \SearchRequestFactoryInterface ;
13+ use Illuminate \Database \Eloquent \Collection ;
1314use Illuminate \Database \Eloquent \Collection as EloquentCollection ;
1415use Illuminate \Database \Eloquent \Model ;
1516use Illuminate \Pagination \Cursor ;
@@ -40,6 +41,8 @@ public function __construct(
4041
4142 /**
4243 * Update the given models in the index.
44+ *
45+ * @param Collection $models
4346 */
4447 public function update ($ models ): void
4548 {
@@ -56,6 +59,8 @@ public function update($models): void
5659
5760 /**
5861 * Delete the given models from the index.
62+ *
63+ * @param Collection $models
5964 */
6065 public function delete ($ models ): void
6166 {
@@ -82,6 +87,9 @@ public function search(Builder $builder): SearchResponse
8287
8388 /**
8489 * Perform the given paginated search.
90+ *
91+ * @param int $perPage
92+ * @param int $page
8593 */
8694 public function paginate (Builder $ builder , $ perPage , $ page ): SearchResponse
8795 {
@@ -95,8 +103,12 @@ public function paginate(Builder $builder, $perPage, $page): SearchResponse
95103
96104 /**
97105 * Cursor paginate the given search using OpenSearch search_after values.
106+ *
107+ * @param int|null $perPage
108+ * @param string $cursorName
109+ * @param Cursor|null $cursor
98110 */
99- public function cursorPaginate (Builder $ builder , $ perPage = null , string $ cursorName = 'cursor ' , Cursor | string | null $ cursor = null ): CursorPaginator
111+ public function cursorPaginate (Builder $ builder , $ perPage = null , $ cursorName = 'cursor ' , $ cursor = null ): CursorPaginator
100112 {
101113 $ perPage = (int ) ($ perPage ?: $ builder ->model ->getPerPage ());
102114
@@ -137,6 +149,9 @@ public function mapIds($results): BaseCollection
137149
138150 /**
139151 * Map the search results to models.
152+ *
153+ * @param SearchResponse $results
154+ * @param Model $model
140155 */
141156 public function map (Builder $ builder , $ results , $ model ): EloquentCollection
142157 {
@@ -145,6 +160,9 @@ public function map(Builder $builder, $results, $model): EloquentCollection
145160
146161 /**
147162 * Lazily map the search results to models.
163+ *
164+ * @param SearchResponse $results
165+ * @param Model $model
148166 */
149167 public function lazyMap (Builder $ builder , $ results , $ model ): LazyCollection
150168 {
@@ -153,6 +171,8 @@ public function lazyMap(Builder $builder, $results, $model): LazyCollection
153171
154172 /**
155173 * Get the total count from the search results.
174+ *
175+ * @param SearchResponse $results
156176 */
157177 public function getTotalCount ($ results ): ?int
158178 {
@@ -177,6 +197,8 @@ protected function searchAfterValuesByDocumentId(SearchResponse $response): arra
177197
178198 /**
179199 * Remove all model records from the index.
200+ *
201+ * @param Model $model
180202 */
181203 public function flush ($ model ): void
182204 {
@@ -189,6 +211,8 @@ public function flush($model): void
189211
190212 /**
191213 * Create an index.
214+ *
215+ * @param string $name
192216 */
193217 public function createIndex ($ name , array $ options = []): void
194218 {
@@ -201,6 +225,8 @@ public function createIndex($name, array $options = []): void
201225
202226 /**
203227 * Delete an index.
228+ *
229+ * @param string $name
204230 */
205231 public function deleteIndex ($ name ): void
206232 {
0 commit comments