Code Duplication    Length = 14-14 lines in 2 locations

src/Search/Query/Joining/HasParentQuery.php 1 location

@@ 29-42 (lines=14) @@
26
    /**
27
     * @inheritdoc
28
     */
29
    public function toArray()
30
    {
31
        $hasParent = [
32
            'parent_type'  => $this->getType(),
33
            'query'        => $this->getQuery()->toArray(),
34
        ];
35
36
        $scoreMode = $this->getScoreMode();
37
        if (!is_null($scoreMode)) {
38
            $hasParent['score_mode'] = $scoreMode;
39
        }
40
41
        return ['has_parent' => $hasParent];
42
    }
43
44
    /**
45
     * @inheritdoc

src/Search/Query/Joining/NestedQuery.php 1 location

@@ 29-42 (lines=14) @@
26
    /**
27
     * @inheritdoc
28
     */
29
    public function toArray()
30
    {
31
        $nested = [
32
            'path'  => $this->getPath(),
33
            'query' => $this->getQuery()->toArray(),
34
        ];
35
36
        $scoreMode = $this->getScoreMode();
37
        if (!is_null($scoreMode)) {
38
            $nested['score_mode'] = $scoreMode;
39
        }
40
41
        return ['nested' => $nested];
42
    }
43
44
    /**
45
     * @inheritdoc