File tree 4 files changed +8
-6
lines changed
4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -16,16 +16,14 @@ public function __construct(private readonly ElasticsearchClient $elasticSearchC
16
16
}
17
17
18
18
/**
19
- * @param array<string,mixed> $query
19
+ * @param array<string,mixed> $query
20
20
*/
21
21
public function search (array $ query ): Elasticsearch
22
22
{
23
23
return $ this ->elasticSearchClient ->search ($ query );
24
24
}
25
25
26
26
/**
27
- * @param Elasticsearch $searchResultsResponse
28
- *
29
27
* @return Collection<array-key, SearchResult|SearchResultInterface>
30
28
*/
31
29
public function createCollectionResponse (Elasticsearch $ searchResultsResponse ): Collection
@@ -34,7 +32,7 @@ public function createCollectionResponse(Elasticsearch $searchResultsResponse):
34
32
35
33
$ hits = new Collection ($ searchResults ['hits ' ]['hits ' ]);
36
34
37
- if (!app ()->bound (SearchResultInterface::class)) {
35
+ if (! app ()->bound (SearchResultInterface::class)) {
38
36
/* @phpstan-ignore-next-line */
39
37
return $ hits ->map (
40
38
static fn (array $ document ): SearchResult => SearchResult::fromElasticsearchResult ($ document )
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ trait SyncsWithIndex
15
15
{
16
16
protected static function bootSyncsWithIndex (): void
17
17
{
18
- if (!config ('elasticsearch.enabled ' )) {
18
+ if (! config ('elasticsearch.enabled ' )) {
19
19
return ;
20
20
}
21
21
Original file line number Diff line number Diff line change 10
10
class Document implements DocumentInterface
11
11
{
12
12
protected string $ id ;
13
+
13
14
protected string $ type ;
15
+
14
16
protected Carbon $ date ;
15
17
16
18
public function setId (string $ id ): static
Original file line number Diff line number Diff line change 12
12
class SearchResult implements Arrayable, SearchResultInterface
13
13
{
14
14
protected string $ id ;
15
+
15
16
protected string $ type ;
17
+
16
18
protected Carbon $ date ;
17
19
18
20
public function getId (): string
@@ -52,7 +54,7 @@ public function getDate(): Carbon
52
54
}
53
55
54
56
/**
55
- * @param array<string, mixed> $values
57
+ * @param array<string, mixed> $values
56
58
*/
57
59
public static function fromElasticsearchResult (array $ values ): self
58
60
{
You can’t perform that action at this time.
0 commit comments