Code Duplication    Length = 8-8 lines in 2 locations

Subscriber/PaginateElasticaQuerySubscriber.php 2 locations

@@ 96-103 (lines=8) @@
93
            'order' => $this->getSortDirection($sortField, $options),
94
        ];
95
96
        if (isset($options['sortNestedPath'])) {
97
            $path = is_callable($options['sortNestedPath']) ?
98
                $options['sortNestedPath']($sortField) : $options['sortNestedPath'];
99
100
            if (!empty($path)) {
101
                $sort['nested_path'] = $path;
102
            }
103
        }
104
105
        if (isset($options['sortNestedFilter'])) {
106
            $filter = is_callable($options['sortNestedFilter']) ?
@@ 105-112 (lines=8) @@
102
            }
103
        }
104
105
        if (isset($options['sortNestedFilter'])) {
106
            $filter = is_callable($options['sortNestedFilter']) ?
107
                $options['sortNestedFilter']($sortField) : $options['sortNestedFilter'];
108
109
            if (!empty($filter)) {
110
                $sort['nested_filter'] = $filter;
111
            }
112
        }
113
114
        return $sort;
115
    }