Code Duplication    Length = 8-8 lines in 2 locations

Subscriber/PaginateElasticaQuerySubscriber.php 2 locations

@@ 81-88 (lines=8) @@
78
            'order' => $this->getSortDirection($sortField, $options),
79
        ];
80
81
        if (isset($options['sortNestedPath'])) {
82
            $path = is_callable($options['sortNestedPath']) ?
83
                $options['sortNestedPath']($sortField) : $options['sortNestedPath'];
84
85
            if (!empty($path)) {
86
                $sort['nested_path'] = $path;
87
            }
88
        }
89
90
        if (isset($options['sortNestedFilter'])) {
91
            $filter = is_callable($options['sortNestedFilter']) ?
@@ 90-97 (lines=8) @@
87
            }
88
        }
89
90
        if (isset($options['sortNestedFilter'])) {
91
            $filter = is_callable($options['sortNestedFilter']) ?
92
                $options['sortNestedFilter']($sortField) : $options['sortNestedFilter'];
93
94
            if (!empty($filter)) {
95
                $sort['nested_filter'] = $filter;
96
            }
97
        }
98
99
        return $sort;
100
    }